|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.core.Session
org.basex.server.ClientSession
public final class ClientSession
This wrapper sends commands to the server instance over a socket
connection. It extends the Session
class:
execute(java.lang.String, java.io.OutputStream)
method sends database commands to the server.
All strings are encoded as UTF8 and suffixed by a zero byte.close()
closes the session by sending the Commands.Cmd.EXIT
command to the server.
Constructor Summary | |
---|---|
ClientSession(Context context,
String user,
String pw)
Constructor, specifying the database context and the login and password. |
|
ClientSession(String host,
int port,
String user,
String pw)
Constructor, specifying the server host:port combination and the login and password. |
Method Summary | |
---|---|
void |
close()
Closes the session. |
boolean |
execute(Proc pr,
OutputStream o)
Executes a process and prints the result to the specified stream. |
boolean |
execute(String cmd,
OutputStream o)
Executes a command and prints the result to the specified stream. |
String |
info()
Returns process info. |
Methods inherited from class org.basex.core.Session |
---|
execute, execute |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientSession(Context context, String user, String pw) throws IOException
context
- database contextuser
- user namepw
- password
IOException
- I/O exceptionpublic ClientSession(String host, int port, String user, String pw) throws IOException
host
- server nameport
- server portuser
- user namepw
- password
IOException
- I/O exceptionMethod Detail |
---|
public boolean execute(String cmd, OutputStream o) throws IOException
Session
execute
in class Session
cmd
- command to be executedo
- output stream
IOException
- I/O exceptionpublic boolean execute(Proc pr, OutputStream o) throws IOException
Session
execute
in class Session
pr
- process to be executedo
- output stream
IOException
- I/O exceptionpublic String info()
Session
info
in class Session
public void close() throws IOException
Session
close
in class Session
IOException
- I/O exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |