edu.vt.marian.server
Class session_table

java.lang.Object
  |
  +--edu.vt.marian.server.session_table

public class session_table
extends java.lang.Object

class name: session_table class description: this class is used by session manager object to do the mapping between client id, user id and session id, it can be considered as a table with four columns, the first is client id, the second is user id, the third is session id and the last is session object. uses the services of class(es): designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): Ning Chai (nchai@csgrad.cs.vt.edu) finished time: Nov 26th, 1998 known bugs: JDK version: 1.1.5 side effects:


Field Summary
static int CANNOT_FIND_SESSION
           
static int INVALID_NUMBER
           
static int INVALID_PARAMETER
           
static int INVALID_TIME
           
static int NO_UNUSED_SESSION_ID
           
static int NULL_PARAMETER
           
static int NULL_RPC_FUNCTION
           
static int OK
           
static int PROCESS_CALL_FROM_C_FAILED
           
static int PROCESS_CALL_FROM_CLIENT_FAILED
           
static int PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED
           
static int PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED
           
static int SESSION_TABLE_OVERFLOWED
           
 
Constructor Summary
session_table(session_manager sm, java.lang.String dir_name, resource_manager rm, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a session table object, this object is created by the specified session manager object and the specified directory contains all the configuration information about this object uses the services of class(es): input parameter(s): sm -- this is the session manager object which created this object file_name -- this is the name of the directory which contains all the configuration information of this object debug -- used for debugging output parameter(s): none return value: none synchronization: none
 
Method Summary
 int delete_old_sessions(long time)
          method description: this method will delete all the session entries which has no activity longer than the specified time uses the services of class(es): input parameter(s): time -- the threhold value used to delete sessions, the unit is ms output parameter(s): none return value: non negative number -- number of sessions deleted INVALID_TIME -- the time is negative and doesn't make sense other -- synchronization: writer method
 int exit(java.lang.String condition)
          method description: this method will release all the resource occupied by this object, kill all the threads it created.
 int get_max_number_sessions()
          method description: this method will tell at most how many sessions can be stored in this object.
 int get_number_sessions()
          method description: this method will tell the current number of sessions in this table uses the services of class(es): input parameter(s): none output parameter(s): none return value: the current number of sessions in this table as an integer synchronization: none
 int process_call_from_c(edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent by C/C++ marian server.
 int process_call_from_client(int client_id, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent by the client (currently webgate).
 int process_call_from_session_to_c(int session_id, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent from one of it's session objects to C/C++ marian server.
 int process_call_from_session_to_client_by_thread(int session_id, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent from one of it's session objects to client by thread (currently webgate).
 int process_call_from_session_to_client(int session_id, edu.vt.marian.uip.rpc_function rf)
          method description: this method will process the function sent from one of it's session objects to client (currently webgate).
 int set_max_number_sessions(int number)
          method description: this method will set the maximum possible number of sessions can be stored in this table uses the services of class(es): input parameter(s): number -- this will become the new upper limit output parameter(s): none return value: OK -- the number has been set correctly INVALID_NUMBER -- the number is negative and doesn't make sense other -- synchronization: none
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK

INVALID_TIME

public static final int INVALID_TIME

INVALID_NUMBER

public static final int INVALID_NUMBER

NULL_RPC_FUNCTION

public static final int NULL_RPC_FUNCTION

NULL_PARAMETER

public static final int NULL_PARAMETER

INVALID_PARAMETER

public static final int INVALID_PARAMETER

PROCESS_CALL_FROM_CLIENT_FAILED

public static final int PROCESS_CALL_FROM_CLIENT_FAILED

PROCESS_CALL_FROM_C_FAILED

public static final int PROCESS_CALL_FROM_C_FAILED

SESSION_TABLE_OVERFLOWED

public static final int SESSION_TABLE_OVERFLOWED

NO_UNUSED_SESSION_ID

public static final int NO_UNUSED_SESSION_ID

CANNOT_FIND_SESSION

public static final int CANNOT_FIND_SESSION

PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED

public static final int PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED

PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED

public static final int PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED
Constructor Detail

session_table

public session_table(session_manager sm,
                     java.lang.String dir_name,
                     resource_manager rm,
                     edu.vt.marian.common.Debug debug)
method description: this constructor will create a session table object, this object is created by the specified session manager object and the specified directory contains all the configuration information about this object uses the services of class(es): input parameter(s): sm -- this is the session manager object which created this object file_name -- this is the name of the directory which contains all the configuration information of this object debug -- used for debugging output parameter(s): none return value: none synchronization: none
Method Detail

get_number_sessions

public int get_number_sessions()
method description: this method will tell the current number of sessions in this table uses the services of class(es): input parameter(s): none output parameter(s): none return value: the current number of sessions in this table as an integer synchronization: none

get_max_number_sessions

public int get_max_number_sessions()
method description: this method will tell at most how many sessions can be stored in this object. uses the services of class(es): input parameter(s): none output parameter(s): none return value: the maximum possible number of sessions allowed in this table as an integer synchronization: none

set_max_number_sessions

public int set_max_number_sessions(int number)
method description: this method will set the maximum possible number of sessions can be stored in this table uses the services of class(es): input parameter(s): number -- this will become the new upper limit output parameter(s): none return value: OK -- the number has been set correctly INVALID_NUMBER -- the number is negative and doesn't make sense other -- synchronization: none

delete_old_sessions

public int delete_old_sessions(long time)
method description: this method will delete all the session entries which has no activity longer than the specified time uses the services of class(es): input parameter(s): time -- the threhold value used to delete sessions, the unit is ms output parameter(s): none return value: non negative number -- number of sessions deleted INVALID_TIME -- the time is negative and doesn't make sense other -- synchronization: writer method

process_call_from_client

public int process_call_from_client(int client_id,
                                    edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent by the client (currently webgate). uses the services of class(es): input parameter(s): client_id -- identifies which client (webgate) send this function rf -- the rpc function need to be processed output parameter(s): none return value: OK -- the function has been processed correctly NULL_RPC_FUNCTION -- parameter rf is null NULL_PARAMETER -- can't find parameter in rf INVALID_PARAMETER -- parameter's type of rf is invalid SESSION_TABLE_OVERFLOWED -- session table overflowed and can not create a new user PROCESS_CALL_FROM_CLIENT_FAILED -- error happens when session process the function NO_UNUSED_SESSION_ID -- not enough id available to use synchronization: writer method

process_call_from_c

public int process_call_from_c(edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent by C/C++ marian server. uses the services of class(es): input parameter(s): rf -- the rpc function sent by C/C++ server and need to be processed output parameter(s): none return value: OK -- the function has been processed correctly NULL_RPC_FUNCTION -- the rf is null NULL_PARAMETER -- no parameter is found in rf INVALID_PARAMETER -- the parameter's type of rf is invalid CANNOT_FIND_SESSION -- can not find a session with the specified session id PROCESS_CALL_FROM_C_FAILED -- error happens when session process the function synchronization: reader method

process_call_from_session_to_client

public int process_call_from_session_to_client(int session_id,
                                               edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent from one of it's session objects to client (currently webgate). uses the services of class(es): input parameter(s): session_id -- specifies which session send this function rf -- the rpc function sent by the session output parameter(s): none return value: ok -- can not find corresponding client id and user id other -- synchronization: none

process_call_from_session_to_client_by_thread

public int process_call_from_session_to_client_by_thread(int session_id,
                                                         edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent from one of it's session objects to client by thread (currently webgate). uses the services of class(es): input parameter(s): session_id -- specifies which session send this function rf -- the rpc function sent by the session output parameter(s): none return value: OK -- the function has been processed correctly NULL_RPC_FUNCTION -- the rf is null CANNOT_FIND_SESSION -- can not find a session with the specified session id PROCESS_CALL_FROM_SESSION_TABLE_TO_CLIENT_FAILED -- error happens when session manager process the function synchronization: reader method

process_call_from_session_to_c

public int process_call_from_session_to_c(int session_id,
                                          edu.vt.marian.uip.rpc_function rf)
method description: this method will process the function sent from one of it's session objects to C/C++ marian server. uses the services of class(es): input parameter(s): session_id -- specifies which session send this function rf -- the rpc function sent by the session output parameter(s): none return value: OK -- the function has been processed correctly NULL_RPC_FUNCTION -- rf is null PROCESS_CALL_FROM_SESSION_TABLE_TO_C_FAILED -- error happens when session manager process the function synchronization: none

exit

public int exit(java.lang.String condition)
method description: this method will release all the resource occupied by this object, kill all the threads it created. uses the services of class(es): input parameter(s): condition -- specifies under which condition this method is called output parameter(s): none return value: OK -- the exit is smooth other -- synchronization: writer method