|
||||||||||
| 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 exception
public ClientSession(String host,
int port,
String user,
String pw)
throws IOException
host - server nameport - server portuser - user namepw - password
IOException - I/O exception| Method Detail |
|---|
public boolean execute(String cmd,
OutputStream o)
throws IOException
Session
execute in class Sessioncmd - command to be executedo - output stream
IOException - I/O exception
public boolean execute(Proc pr,
OutputStream o)
throws IOException
Session
execute in class Sessionpr - 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 SessionIOException - I/O exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||