Package org.basex
Class BaseXServer
- java.lang.Object
-
- org.basex.util.Main
-
- org.basex.core.CLI
-
- org.basex.BaseXServer
-
-
Constructor Summary
Constructors Constructor Description BaseXServer(String... args)
Constructor.BaseXServer(Context ctx, String... args)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
header()
Returns a header string for command-line information.static void
main(String... args)
Main method, launching the server process.protected void
parseArgs()
Parses the command-line arguments, specified by the user.static boolean
ping(String host, int port)
Checks if a server is running.void
remove(ClientListener client)
Removes a client listener that is waiting for authentication.void
run()
static void
start(int port, String... args)
Starts the database server in a separate process.void
stop()
Stops the server.static void
stop(String host, int port)
Stops the server.String
usage()
Returns a usage string for command-line information.
-
-
-
Constructor Detail
-
BaseXServer
public BaseXServer(String... args) throws IOException
Constructor.- Parameters:
args
- command-line arguments- Throws:
IOException
- I/O exception
-
BaseXServer
public BaseXServer(Context ctx, String... args) throws IOException
Constructor.- Parameters:
ctx
- database contextargs
- command-line arguments- Throws:
IOException
- I/O exception
-
-
Method Detail
-
main
public static void main(String... args)
Main method, launching the server process. Command-line arguments are listed with the-h
argument.- Parameters:
args
- command-line arguments
-
stop
public void stop() throws IOException
Stops the server.- Throws:
IOException
- I/O exception
-
parseArgs
protected void parseArgs() throws IOException
Description copied from class:Main
Parses the command-line arguments, specified by the user.- Specified by:
parseArgs
in classMain
- Throws:
IOException
- I/O exception
-
header
public String header()
Description copied from class:Main
Returns a header string for command-line information.
-
usage
public String usage()
Description copied from class:Main
Returns a usage string for command-line information.
-
start
public static void start(int port, String... args) throws BaseXException
Starts the database server in a separate process.- Parameters:
port
- server portargs
- command-line arguments- Throws:
BaseXException
- database exception
-
ping
public static boolean ping(String host, int port)
Checks if a server is running.- Parameters:
host
- hostport
- server port- Returns:
- boolean success
-
stop
public static void stop(String host, int port) throws IOException
Stops the server.- Parameters:
host
- server hostport
- server port- Throws:
IOException
- I/O exception
-
remove
public void remove(ClientListener client)
Removes a client listener that is waiting for authentication.- Parameters:
client
- client to be removed
-
-