asjava.uniobjects
Class UniJava

java.lang.Object
  extended byasjava.uniobjects.UniJava

public class UniJava
extends java.lang.Object

UniJava is the base class for the UniObjects for Java product. Its primary purpose is object marshalling and enumeration, as well as instantiation of all UniSession objects. One UniJava object MUST be created by every application that uses this API.

Since:
UNIOBJECTS 1.0
Version:
Version 1.0
Author:
David T. Meeks

Constructor Summary
UniJava()
          Constructs a UniJava object.
 
Method Summary
static void closeAllCPSessions()
           
 void closeAllSessions()
          This method will close all open sessions by going through the uniSessionsVector list and calling the UniSession.disconnect() method for each individual session.
static void closeServerConnection(UniSession us)
          This function physically closes given connection.
 void closeSession(UniSession aSession)
          This method will close the session passed into it.
protected static void closeSessionInternal(UniSession aSession)
           
static int getIdleRemoveExecInterval()
          retuns Idle Remove Execution Interval.
static int getIdleRemoveThreshold()
          returns Idle Remove Threshold
static int getMaxPoolSize()
          returns Maximum Pool Size Number.
 int getMaxSessions()
          The maximum number of open sessions that can be open.
static int getMinPoolSize()
          returns Minimum Pool Size Number.
 int getNumSessions()
          The current number of open sessions that are open.
static int getOpenSessionTimeOut()
          returns Open Session TimeOut
static int getSocketTimeout()
          returns Socket Time Out
static boolean getUOPooling()
          returns UOJ Connection Pooling flag
 java.lang.String getVersionNumber()
          The current version number
protected static UniSession openPooledSession(java.lang.String hostname, int hostport, java.lang.String userid, java.lang.String password, java.lang.String account, java.lang.String service, int sslmode)
          This function is called by 4 above overloaded openSession() functions.
 UniSession openSession()
          Instantiates a new UniSession object.
 UniSession openSession(int sslmode)
          Instantiates a new UniSession object.
static void setIdleRemoveExecInterval(int pidleRemoveExecInterval)
          sets Idle Remove Execution Interval.
static void setIdleRemoveThreshold(int pidleRemoveThreshold)
          set Idle Remove Threshold
static void setMaxPoolSize(int pmaxPoolSize)
          sets Maximum Pool Size Number.
static void setMinPoolSize(int pminPoolSize)
          sets Maximum Pool Size Number.
static void setOpenSessionTimeOut(int ptimeout)
          sets Open Session TimeOut
static void setPoolingDebug(boolean debug)
          sets Debug Level for trace.
static void setSocketTimeout(int ptimeout)
          sets Socket Time Out
static void setUOPooling(boolean puoPooling)
          sets UOJ Connection Pooling flag
protected static void uniLog(java.lang.String message)
          This fucntion is used to write trace log related with info
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniJava

public UniJava()
Constructs a UniJava object.

Since:
UNIOBJECTS 1.0
Method Detail

setPoolingDebug

public static void setPoolingDebug(boolean debug)
sets Debug Level for trace.

Parameters:
debug - boolean representing debug level.ON=true,OFF=false

uniLog

protected static void uniLog(java.lang.String message)
This fucntion is used to write trace log related with info

Parameters:
message - String representing message contents

closeAllSessions

public void closeAllSessions()
                      throws asjava.unirpc.UniRPCConnectionException,
                             UniSessionException
This method will close all open sessions by going through the uniSessionsVector list and calling the UniSession.disconnect() method for each individual session. It will then eliminate all entries from the uniSessionsVector.

Throws:
UniSessionException - is thrown if an error occurs
asjava.unirpc.UniRPCConnectionException
Since:
UNIOBJECTS 1.0
See Also:
closeSession(asjava.uniobjects.UniSession)

closeAllCPSessions

public static void closeAllCPSessions()
                               throws asjava.unirpc.UniRPCConnectionException,
                                      UniSessionException
Throws:
asjava.unirpc.UniRPCConnectionException
UniSessionException

closeSession

public void closeSession(UniSession aSession)
                  throws UniSessionException
This method will close the session passed into it. It will do this by calling the UniSession.disconnect() method, allowing the session to properly close. It will also remove the entry from the uniSessionsVector.

Parameters:
aSession - the UniSession object that should be closed
Throws:
UniSessionException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
closeAllSessions()

closeSessionInternal

protected static void closeSessionInternal(UniSession aSession)
                                    throws UniSessionException
Throws:
UniSessionException

getMaxSessions

public int getMaxSessions()
The maximum number of open sessions that can be open. If a 0 is returned, there is no set limit.

Returns:
the maximum number of open sessions, or a 0 for unlimited session support
Since:
UNIOBJECTS 1.0

getNumSessions

public int getNumSessions()
The current number of open sessions that are open.

Returns:
the current number of open sessions
Since:
UNIOBJECTS 1.0

getVersionNumber

public java.lang.String getVersionNumber()
The current version number

Returns:
the current version number
Since:
UNIOBJECTS 1.0

openSession

public UniSession openSession()
                       throws UniSessionException
Instantiates a new UniSession object. It also stores the reference into the uniSessionsVector. If an error occurs, it throws a UniSessionException

Returns:
a UniSession object
Throws:
UniSessionException - if it encounters an error during creation.
Since:
UNIOBJECTS 1.0

openSession

public UniSession openSession(int sslmode)
                       throws UniSessionException
Instantiates a new UniSession object. It also stores the reference into the uniSessionsVector. If an error occurs, it throws a UniSessionException

Returns:
a UniSession object
Throws:
UniSessionException - if it encounters an error during creation.
Since:
UNIOBJECTS 1.0

closeServerConnection

public static void closeServerConnection(UniSession us)
                                  throws UniSessionException
This function physically closes given connection.

Parameters:
us - UniSession Object
Throws:
UniSessionException - is thrown if an error occurs

openPooledSession

protected static UniSession openPooledSession(java.lang.String hostname,
                                              int hostport,
                                              java.lang.String userid,
                                              java.lang.String password,
                                              java.lang.String account,
                                              java.lang.String service,
                                              int sslmode)
                                       throws UniSessionException
This function is called by 4 above overloaded openSession() functions.

Parameters:
hostname - String representing the name of the host to connect to
userid - String representing the server-side username used for connection purposes.
password - String representing the password to be used for the connection
account - String representing which account to connect to
service - String representing the datasource type.
sslmode - Integer representing the ssl mode.
Returns:
Throws:
UniSessionException - is thrown if an error occurs

getIdleRemoveExecInterval

public static int getIdleRemoveExecInterval()
retuns Idle Remove Execution Interval.

Returns:
idleRemoveExecInterval Integer representing Idle Remove Execution Interval.

setIdleRemoveExecInterval

public static void setIdleRemoveExecInterval(int pidleRemoveExecInterval)
sets Idle Remove Execution Interval.


getIdleRemoveThreshold

public static int getIdleRemoveThreshold()
returns Idle Remove Threshold

Returns:
idleRemoveThreshold. Integer representing Idle Remove Threshold

setIdleRemoveThreshold

public static void setIdleRemoveThreshold(int pidleRemoveThreshold)
set Idle Remove Threshold


getSocketTimeout

public static int getSocketTimeout()
returns Socket Time Out

Returns:
socketTimeout Integer representing Socket Time Out

setSocketTimeout

public static void setSocketTimeout(int ptimeout)
sets Socket Time Out


getOpenSessionTimeOut

public static int getOpenSessionTimeOut()
returns Open Session TimeOut

Returns:
poolingOpenSessionTimeout Integer representing Open Session TimeOut

setOpenSessionTimeOut

public static void setOpenSessionTimeOut(int ptimeout)
sets Open Session TimeOut


getUOPooling

public static boolean getUOPooling()
returns UOJ Connection Pooling flag

Returns:
uoPooling Integer representing UOJ Connection Pooling flag

setUOPooling

public static void setUOPooling(boolean puoPooling)
sets UOJ Connection Pooling flag


getMaxPoolSize

public static int getMaxPoolSize()
returns Maximum Pool Size Number.

Returns:
maxPoolSize Integer representing Min Pool Size.

setMaxPoolSize

public static void setMaxPoolSize(int pmaxPoolSize)
sets Maximum Pool Size Number.


getMinPoolSize

public static int getMinPoolSize()
returns Minimum Pool Size Number.

Returns:
minPoolSize Integer representing Min Pool Size.

setMinPoolSize

public static void setMinPoolSize(int pminPoolSize)
sets Maximum Pool Size Number.