org.basex.server
Class ClientSession

java.lang.Object
  extended by org.basex.core.Session
      extended by org.basex.server.ClientSession

public final class ClientSession
extends Session

This wrapper sends commands to the server instance over a socket connection. It extends the Session class:

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

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

ClientSession

public ClientSession(Context context,
                     String user,
                     String pw)
              throws IOException
Constructor, specifying the database context and the login and password.

Parameters:
context - database context
user - user name
pw - password
Throws:
IOException - I/O exception

ClientSession

public ClientSession(String host,
                     int port,
                     String user,
                     String pw)
              throws IOException
Constructor, specifying the server host:port combination and the login and password.

Parameters:
host - server name
port - server port
user - user name
pw - password
Throws:
IOException - I/O exception
Method Detail

execute

public boolean execute(String cmd,
                       OutputStream o)
                throws IOException
Description copied from class: Session
Executes a command and prints the result to the specified stream.

Specified by:
execute in class Session
Parameters:
cmd - command to be executed
o - output stream
Returns:
success of operation
Throws:
IOException - I/O exception

execute

public boolean execute(Proc pr,
                       OutputStream o)
                throws IOException
Description copied from class: Session
Executes a process and prints the result to the specified stream.

Specified by:
execute in class Session
Parameters:
pr - process to be executed
o - output stream
Returns:
success of operation
Throws:
IOException - I/O exception

info

public String info()
Description copied from class: Session
Returns process info.

Specified by:
info in class Session
Returns:
process info

close

public void close()
           throws IOException
Description copied from class: Session
Closes the session.

Specified by:
close in class Session
Throws:
IOException - I/O exception