All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class asjava.uniobjects.UniSession

java.lang.Object
   |
   +----asjava.uniclientlibs.UniConnection
           |
           +----asjava.uniobjects.UniSession

public class UniSession
extends UniConnection
UniSession acts as the central object for any database connection, controlling access to any and all child objects. It controls information regarding the connection. It is from this object that the various sub-objects are created, such as the UniSelectList, UniFile, UniSubroutine and other objects. Multiple sessions can be created, up to UniJava.getMaxSessions

Version:
Version 1.0
Author:
David T. Meeks

Variable Index

 o atVariableArray
 o uniCommand
 o uniNLSLocale
 o uniNLSMap

Constructor Index

 o UniSession()
Constructor for this class.
 o UniSession(UniSession)
Constructor for this class.

Method Index

 o command()
Creates the command object for this session
 o command(Object)
Creates the command object for this session, uses the passed in argument as the default command to run
 o connect()
Opens up the session on the host identified with the setHost method.
 o connect(Object, int, Object, Object, Object)
Establishes connection to the Host/Port passed in, using the Username, Password, and initial account path passed in.
 o connect(Object, int, Object, Object, Object, Object, Object)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.
 o connect(Object, Object, Object, Object)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.
 o connect(Object, Object, Object, Object, Object, int, Object)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.
 o connect(Object, Object, Object, Object, Object, Object)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.
 o disconnect()
Terminates an active connection.
 o dynArray()
Creates an empty dynamic array
 o dynArray(Object)
Creates a dynamic array from the given object
 o getAtVariable(int)
returns the current value of the
 o getDefaultBlockingStrategy()
returns the default blocking strategy for this session.
 o getDefaultLockStrategy()
returns the default locking strategy for this session.
 o getDefaultReleaseStrategy()
returns the default release strategy for this session.
 o getMaxOpenFiles()
returns the maximum number of UniFile objects we can open at any one time.
 o getNumOpenFiles()
returns the current number of open UniFile objects.
 o getValue(int)
used to get a AT value from the server
 o iconv(Object, Object)
converts an input string into a UniVerse internal storage format using the conversion format specified.
 o isCommandActive()
checks to see if a command is in an active state
 o nlsLocale()
If NLS is enabled on the server machine, this method will return an active UniNLSlocale object, which can then be used to manipulate server-side NLS Locale settings.
 o nlsMap()
If NLS is enabled on the server machine, this method will return an active UniNLSmap object, which can then be used to manipulate server-side NLS Map settings.
 o oconv(Object, Object)
converts an output string into a UniVerse output storage format using the conversion format specified.
 o open(Object)
returns a new UniFile object.
 o openDict(Object)
returns a new UniDictionary object.
 o openFile(Object)
returns a new UniFile object.
 o openSeq(Object, Object, boolean)
returns a new UniSequentialFile object.
 o releaseTaskLock(int)
used to release a TaskLock that was set previously using the setTaskLock method.
 o selectList(int)
returns a newly created UniSelectList object
 o setAtVariable(int, Object)
sets the given
 o setCompressionThreshold(int)
sets the current CompressionThreshold value.
 o setDefaultBlockingStrategy(int)
sets the default blocking strategy
 o setDefaultEncryptionType(int)
sets the current default encryption type to be used for this session.
 o setDefaultLockStrategy(int)
sets the default locking strategy
 o setDefaultReleaseStrategy(int)
sets the default release strategy
 o setTaskLock(int)
used to set on of the 64 UniVerse synchronization locks.
 o setTimeout(int)
Sets the UniRPC timeout value.
 o status()
returns information concerning the state of certain operations.
 o subroutine(Object, int)
returns a new UniSubroutine representing the new subroutine object created.
 o transaction()
returns a new UniTransaction object to allow transactional control of the session.

Variables

 o uniCommand
 protected UniCommand uniCommand
 o uniNLSLocale
 protected UniNLSlocale uniNLSLocale
 o uniNLSMap
 protected UniNLSmap uniNLSMap
 o atVariableArray
 protected String atVariableArray[]

Constructors

 o UniSession
 public UniSession()
Constructor for this class. It establishes the UniRPCConnection object.

 o UniSession
 public UniSession(UniSession aSession) throws UniSessionException
Constructor for this class. It establishes the UniRPCConnection object. This version multiplexes the connection through an existing connection

Parameters:
aSession - UniSession representing an existing active session
Throws: UniSessionException
is thrown if an error occurs

Methods

 o command
 public UniCommand command() throws UniSessionException
Creates the command object for this session

Throws: UniSessionException
is thrown if there is no active connection or if their is an error establishing the UniCommand object
 o command
 public UniCommand command(Object aCommandString) throws UniSessionException
Creates the command object for this session, uses the passed in argument as the default command to run

Parameters:
aCommandString - String representing the server-side command/stored procedure to be run. Performs an automatic UniCommand.setCommand() as a convenience.
Throws: UniSessionException
is thrown if there is no active connection or if their is an error establishing the UniCommand object
 o connect
 public void connect() throws UniSessionException
Opens up the session on the host identified with the setHost method. It uses the values established with the setUserName, setPassword, setAccountPath, setProxyHost, and setProxySecurityToken methods. If an error occurs during the connection request, a UniSessionException is thrown.

Throws: UniSessionException
is thrown if the connection cannot be established
See Also:
setUserName, setHostName, setHostPort, setPassword, setAccountPath, setProxyHost, setProxyPort, setProxySecurityToken
 o connect
 public void connect(Object aHost,
                     Object aUser,
                     Object aPass,
                     Object aPath) throws UniSessionException
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.

Parameters:
aHost - String representing the host to connect to. Either the name of the host or the IP address (ex. 192.102.111.1)
aUser - String representing the user name on the server machine.
aPass - String representing the password on the server machine
aPath - String representing the account path to log into on the server machine
Throws: UniSessionException
is thrown if the connection cannot be made
 o connect
 public void connect(Object aHost,
                     int aPortNumber,
                     Object aUser,
                     Object aPass,
                     Object aPath) throws UniSessionException
Establishes connection to the Host/Port passed in, using the Username, Password, and initial account path passed in.

Parameters:
aHost - String representing the host to connect to. Either the name of the host or the IP address (ex. 192.102.111.1)
aPortNumber - integer representing the port to connect to
aUser - String representing the user name on the server machine.
aPass - String representing the password on the server machine
aPath - String representing the account path to log into on the server machine
Throws: UniSessionException
is thrown if the connection cannot be made
 o connect
 public void connect(Object aHost,
                     Object aUser,
                     Object aPass,
                     Object aPath,
                     Object aProxyHost,
                     Object aProxyToken) throws UniSessionException
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.

Parameters:
aHost - String representing the host to connect to. Either the name of the host or the IP address (ex. 192.102.111.1)
aUser - String representing the user name on the server machine.
aPass - String representing the password on the server machine
aPath - String representing the account path to log into on the server machine
aProxyHost - String representing the proxy host to connect to. Either the name of the host or the IP address.
aProxyToken - string representing the Proxy password
Throws: UniSessionException
is thrown if the connection cannot be made
 o connect
 public void connect(Object aHost,
                     Object aUser,
                     Object aPass,
                     Object aPath,
                     Object aProxyHost,
                     int aProxyPort,
                     Object aProxyToken) throws UniSessionException
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.

Parameters:
aHost - String representing the host to connect to. Either the name of the host or the IP address (ex. 192.102.111.1)
aUser - String representing the user name on the server machine.
aPass - String representing the password on the server machine
aPath - String representing the account path to log into on the server machine
aProxyHost - String representing the proxy host to connect to. Either the name of the host or the IP address.
aProxyToken - string representing the Proxy password
Throws: UniSessionException
is thrown if the connection cannot be made
 o connect
 public void connect(Object aHost,
                     int aHostPort,
                     Object aUser,
                     Object aPass,
                     Object aPath,
                     Object aProxyHost,
                     Object aProxyToken) throws UniSessionException
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in.

Parameters:
aHost - String representing the host to connect to. Either the name of the host or the IP address (ex. 192.102.111.1)
aUser - String representing the user name on the server machine.
aPass - String representing the password on the server machine
aPath - String representing the account path to log into on the server machine
aProxyHost - String representing the proxy host to connect to. Either the name of the host or the IP address.
aProxyToken - string representing the Proxy password
Throws: UniSessionException
is thrown if the connection cannot be made
 o disconnect
 public void disconnect() throws UniSessionException
Terminates an active connection. If the connection has not been established, will just return

Throws: UniSessionException
occurs is an error occurs during the termination
See Also:
connect
 o dynArray
 public UniDynArray dynArray()
Creates an empty dynamic array

 o dynArray
 public UniDynArray dynArray(Object aString)
Creates a dynamic array from the given object

Parameters:
aString - object by which the dynamic array will be initialized with
 o getAtVariable
 public String getAtVariable(int aTokenVal) throws UniSessionException
returns the current value of the @variable specified by the input parameter. Valid values for the input value are:

Parameters:
aTokenVal - integer representing which @variable to return.
Returns:
String representing the @variable requested
Throws: UniSessionException
is thrown if an illegal argument is passed in
See Also:
setAtVariable
 o getDefaultBlockingStrategy
 public int getDefaultBlockingStrategy()
returns the default blocking strategy for this session. This controls the default behavior of what requests that block on another lock do. It can be overriden by individual objects or requests. Valid values are:

Returns:
integer representing the current default blocking strategy
See Also:
setDefaultBlockingStrategy
 o getDefaultLockStrategy
 public int getDefaultLockStrategy()
returns the default locking strategy for this session. This controls the default behavior of what type of lock is to be set when data is manipulated. It can be overriden by individual objects or requests. Valid values are:

Returns:
integer representing the current default locking strategy
See Also:
setDefaultLockStrategy
 o getDefaultReleaseStrategy
 public int getDefaultReleaseStrategy()
returns the default release strategy for this session. This controls the default behavior of what requests that manipulate data does to existing locks. It can be overriden by individual objects or requests. Valid values are:
 o getMaxOpenFiles
 public int getMaxOpenFiles()
returns the maximum number of UniFile objects we can open at any one time. A return value of 0 means there is no limit.

Returns:
integer representing the maximum number of files that can be opened.
 o getNumOpenFiles
 public int getNumOpenFiles()
returns the current number of open UniFile objects.

Returns:
integer representing the number of currently active UniFile objects
 o iconv
 public UniString iconv(Object aString,
                        Object aConvCode) throws UniStringException
converts an input string into a UniVerse internal storage format using the conversion format specified. The status function can be used after this method to determine the status of the iconv method.

Parameters:
aInputString - input string that is to be converted
aConvCode - conversion code used to convert the string
Returns:
UniString representing the newly converted string
Throws: UniStringException
is thrown if an error occurs
See Also:
oconv, status
 o nlsLocale
 public UniNLSlocale nlsLocale() throws UniSessionException
If NLS is enabled on the server machine, this method will return an active UniNLSlocale object, which can then be used to manipulate server-side NLS Locale settings.

Returns:
UniNLSlocale object representing the state of the server-side NLS Locale.
Throws: UniSessionException
is thrown if an error occurs
See Also:
nlsMap
 o nlsMap
 public UniNLSmap nlsMap() throws UniSessionException
If NLS is enabled on the server machine, this method will return an active UniNLSmap object, which can then be used to manipulate server-side NLS Map settings.

Returns:
UniNLSmap object representing the state of the server-side NLS map.
Throws: UniSessionException
is thrown if an error occurs
See Also:
nlsLocale
 o oconv
 public UniString oconv(Object aString,
                        Object aConvCode) throws UniStringException
converts an output string into a UniVerse output storage format using the conversion format specified. The status function can be used after this method to determine the status of the oconv method.

Parameters:
aInputString - input string that is to be converted
aConvCode - conversion code used to convert the string
Returns:
UniString representing the newly converted string
Throws: UniStringException
is thrown if an error occurs
See Also:
iconv, status
 o openFile
 public UniFile openFile(Object aFileName) throws UniSessionException
returns a new UniFile object.

Parameters:
aFileName - name of the universe file to be opened.
Returns:
UniFile object representing the newly opened file
Throws: UniSessionException
is thrown if there is an error
 o open
 public UniFile open(Object aFileName) throws UniSessionException
returns a new UniFile object.

Parameters:
aFileName - name of the universe file to be opened.
Returns:
UniFile object representing the newly opened file
Throws: UniSessionException
is thrown if there is an error
 o openDict
 public UniDictionary openDict(Object aFileName) throws UniSessionException
returns a new UniDictionary object.

Parameters:
aFileName - name of the universe dictionary file to be opened.
Returns:
UniDictionary object representing the newly opened dictionary file
Throws: UniSessionException
is thrown if there is an error
 o openSeq
 public UniSequentialFile openSeq(Object aFileName,
                                  Object aRecordID,
                                  boolean aCreateFlag) throws UniSessionException
returns a new UniSequentialFile object.

Parameters:
aFileName - name of the sequential file to be opened. A UniVerse Type 1 or 19 file
aRecordID - refers to a record within the file, optionally created if it does not exist
aCreateFlag - boolean denoting whether or not the file should be created if it does not exist.
Returns:
UniSequentialFile object representing the newly opened sequential file
Throws: UniSessionException
is thrown if there is an error
 o releaseTaskLock
 public void releaseTaskLock(int aLockNum) throws UniSessionException
used to release a TaskLock that was set previously using the setTaskLock method.

Parameters:
aLockNum - integer representing which of the 64 UniVerse task locks is to be set.
Throws: UniSessionException
is thrown if an error occurs.
See Also:
setTaskLock
 o selectList
 public UniSelectList selectList(int aSelectListNumber) throws UniSessionException
returns a newly created UniSelectList object

Parameters:
aSelectListNumber - which UniVerse select list to create
Returns:
UniSelectList object
Throws: UniSessionException
is thrown if an error occurs
 o setAtVariable
 public void setAtVariable(int aTokenVal,
                           Object aAtVariable) throws UniSessionException
sets the given @variable to the value passed in. Only affects UniObjectsTokens.AT_USER_RETURN_CODE (value = 7 )

Parameters:
aTokenVal - integer representing which @variable to set
aAtVariable - String representing the @variables new value
Throws: UniSessionException
is thrown if an invalid aTokenVal is passed in
See Also:
getAtVariable
 o setCompressionThreshold
 public void setCompressionThreshold(int aCompressionThresholdVal) throws UniSessionException
sets the current CompressionThreshold value.

Parameters:
aCompressionThresholdVal - integer representing the amount, in bytes, to set the compression threshold to
Throws: UniSessionException
is thrown if an invalid aCompressionThresholdVal is passed in
 o setDefaultBlockingStrategy
 public void setDefaultBlockingStrategy(int aBlockingStrategy) throws UniSessionException
sets the default blocking strategy

Parameters:
aBlockingStrategy - integer representing the default blocking strategy
Throws: UniSessionException
is thrown if an invalid aBlockingStrategy is passed in
See Also:
getDefaultBlockingStrategy
 o setDefaultEncryptionType
 public void setDefaultEncryptionType(int aEncryptionType) throws UniSessionException
sets the current default encryption type to be used for this session. All subobjects will inherit this value unless specifically overriden. It controls the type of encryption that is to be used for data transfer. Valid values are:
 o setDefaultLockStrategy
 public void setDefaultLockStrategy(int aLockingStrategy) throws UniSessionException
sets the default locking strategy

Parameters:
aLockingStrategy - integer representing the default locking strategy
Throws: UniSessionException
is thrown if an invalid aLockingStrategy is passed in
See Also:
getDefaultLockStrategy
 o setDefaultReleaseStrategy
 public void setDefaultReleaseStrategy(int aReleaseStrategy) throws UniSessionException
sets the default release strategy

Parameters:
aReleaseStrategy - integer representing the default release strategy
Throws: UniSessionException
is thrown if an invalid aReleaseStrategy is passed in
See Also:
getDefaultReleaseStrategy
 o setTaskLock
 public void setTaskLock(int aLockNum) throws UniSessionException
used to set on of the 64 UniVerse synchronization locks.

Parameters:
aLockNum - integer representing which one of the 64 UniVerse synchronization locks is to be set
Throws: UniSessionException
is thrown is an error occurs in obtaining the task lock
See Also:
releaseTaskLock
 o setTimeout
 public void setTimeout(int aTimeoutVal) throws UniSessionException
Sets the UniRPC timeout value. Initially, it is set to 0, indicating no timeout is to occur. If it is set to a value > 0, the UniRPC will timeout after that many seconds.

Parameters:
aTimeoutVal - integer representing the number of seconds the UniRPC should wait until it times out.
Throws: UniSessionException
is thrown if the timeout cannot be set
 o status
 public int status()
returns information concerning the state of certain operations. See those methods for more details

Returns:
s integer representing the status of the last operation performed.
See Also:
connect
 o subroutine
 public UniSubroutine subroutine(Object aSubName,
                                 int aNumArgs) throws UniSessionException
returns a new UniSubroutine representing the new subroutine object created.

Parameters:
aSubName - String representing the name of the subroutine to be executed on the server.
aNumArgs - integer representing the number of arguments this subroutine has
Returns:
UniSubroutine object representing the new subroutine
Throws: UniSessionException
is thrown if an error occurs
 o transaction
 public UniTransaction transaction() throws UniSessionException
returns a new UniTransaction object to allow transactional control of the session.

Returns:
UniTransaction object allow modification of the sessions transactional behavior
Throws: UniSessionException
is thrown if an error occurs
 o getValue
 protected String getValue(int key) throws UniSessionException
used to get a AT value from the server

Parameters:
key - integer representing the key value requested
Returns:
String representing the UniVerse session @variable
Throws: UniSessionException
is thrown if an error occurs
 o isCommandActive
 protected boolean isCommandActive()
checks to see if a command is in an active state

Returns:
boolean stating whether we are in the middle of a command execution or not

All Packages  Class Hierarchy  This Package  Previous  Next  Index