|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.server.Session
public abstract class Session
This class defines methods for evaluating commands, either locally or via the client/server architecture.
The results of database commands are returned as strings. If an output
stream is specified in the constructor or with
setOutputStream(OutputStream)
, results are instead serialized
to that stream.
The class is implemented by the ClientSession
and
LocalSession
classes.
Field Summary | |
---|---|
protected java.io.OutputStream |
out
Client output stream. |
Method Summary | |
---|---|
abstract void |
add(java.lang.String path,
java.io.InputStream input)
Adds a document to the opened database. |
abstract void |
close()
Closes the session. |
abstract void |
create(java.lang.String name,
java.io.InputStream input)
Creates a database. |
java.lang.String |
execute(Command command)
Executes a Command and returns the result as string or serializes
it to the specified output stream. |
protected abstract void |
execute(Command cmd,
java.io.OutputStream os)
Executes a command and prints the result to the specified output stream. |
java.lang.String |
execute(java.lang.String command)
Executes a command and returns the result as string or serializes it to the specified output stream. |
protected abstract void |
execute(java.lang.String cmd,
java.io.OutputStream os)
Executes a command and prints the result to the specified output stream. |
java.io.OutputStream |
getOutputStream()
Returns the assigned output stream. |
java.lang.String |
info()
Returns command info as a string, regardless of whether an output stream was specified. |
abstract Query |
query(java.lang.String query)
Returns a query object for the specified query string. |
abstract void |
replace(java.lang.String path,
java.io.InputStream input)
Replaces a document in an open database. |
void |
setOutputStream(java.io.OutputStream output)
Specifies an output stream. |
abstract void |
store(java.lang.String path,
java.io.InputStream input)
Stores raw data in an open database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.OutputStream out
Method Detail |
---|
public final java.lang.String execute(Command command) throws java.io.IOException
Command
and returns the result as string or serializes
it to the specified output stream.
command
- command to be executed
null
reference
java.io.IOException
- I/O exceptionpublic final java.lang.String execute(java.lang.String command) throws java.io.IOException
command
- command to be parsed
null
reference
java.io.IOException
- I/O exceptionpublic abstract Query query(java.lang.String query) throws java.io.IOException
query
- query string
java.io.IOException
- I/O exceptionpublic abstract void create(java.lang.String name, java.io.InputStream input) throws java.io.IOException
name
- name of databaseinput
- xml input
java.io.IOException
- I/O exceptionpublic abstract void add(java.lang.String path, java.io.InputStream input) throws java.io.IOException
path
- target pathinput
- xml input
java.io.IOException
- I/O exceptionpublic abstract void replace(java.lang.String path, java.io.InputStream input) throws java.io.IOException
path
- document(s) to replaceinput
- new content
java.io.IOException
- I/O exceptionpublic abstract void store(java.lang.String path, java.io.InputStream input) throws java.io.IOException
path
- target pathinput
- binary input
java.io.IOException
- I/O exceptionpublic final java.lang.String info()
public final void setOutputStream(java.io.OutputStream output)
null
as argument.
output
- client output streampublic java.io.OutputStream getOutputStream()
public abstract void close() throws java.io.IOException
java.io.IOException
- I/O exceptionprotected abstract void execute(java.lang.String cmd, java.io.OutputStream os) throws java.io.IOException
cmd
- command to be parsedos
- output stream
java.io.IOException
- I/O exceptionprotected abstract void execute(Command cmd, java.io.OutputStream os) throws java.io.IOException
cmd
- command to be executedos
- output stream
java.io.IOException
- I/O exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |