|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectasjava.uniclientlibs.UniConnection
asjava.uniobjects.UniSession
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
Field Summary | |
---|---|
protected java.lang.String[] |
atVariableArray
|
protected UniCommand |
uniCommand
|
protected UniNLSlocale |
uniNLSLocale
|
protected UniNLSmap |
uniNLSMap
|
protected UniTransaction |
uniTransaction
|
Fields inherited from class asjava.uniclientlibs.UniConnection |
---|
accountPath, compressionThreshold, connection, encryptionType, hostName, hostPort, hostType, inPacket, isActive, isNLSEnabled, isNLSLocalesEnabled, isNLSUnidataSession, isRPCError, licenseToken, outPacket, password, proxyHost, proxyPort, proxySecurityToken, timeout, transport, uniConnectionString, uniDataSourceType, uniMarkCharacters, uniSubKey, userName |
Constructor Summary | |
---|---|
UniSession()
Constructor for this class. |
|
UniSession(int sslmode)
Constructor for this class. |
|
UniSession(UniSession aSession)
Constructor for this class. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
protected java.lang.Object |
clonePooled()
|
UniCommand |
command()
Creates the command object for this session |
UniCommand |
command(java.lang.Object aCommandString)
Creates the command object for this session, uses the passed in argument as the default command to run |
void |
connect()
Opens up the session on the host identified with the setHost method. |
void |
connect(java.lang.Object aHost,
int aPortNumber,
java.lang.Object aUser,
java.lang.Object aPass,
java.lang.Object aPath)
Establishes connection to the Host/Port passed in, using the Username, Password, and initial account path passed in. |
void |
connect(java.lang.Object aHost,
int aHostPort,
java.lang.Object aUser,
java.lang.Object aPass,
java.lang.Object aPath,
java.lang.Object aProxyHost,
java.lang.Object aProxyToken)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in. |
void |
connect(java.lang.Object aHost,
java.lang.Object aUser,
java.lang.Object aPass,
java.lang.Object aPath)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in. |
void |
connect(java.lang.Object aHost,
java.lang.Object aUser,
java.lang.Object aPass,
java.lang.Object aPath,
java.lang.Object aProxyHost,
int aProxyPort,
java.lang.Object aProxyToken)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in. |
void |
connect(java.lang.Object aHost,
java.lang.Object aUser,
java.lang.Object aPass,
java.lang.Object aPath,
java.lang.Object aProxyHost,
java.lang.Object aProxyToken)
Establishes connection to the Host passed in, using the Username, Password, and initial account path passed in. |
protected void |
connectInternal()
|
void |
disconnect()
Terminates an active connection. |
protected void |
disconnectServer()
|
UniDynArray |
dynArray()
Creates an empty dynamic array |
UniDynArray |
dynArray(java.lang.Object aString)
Creates a dynamic array from the given object |
protected void |
finalize()
|
java.lang.String |
getAtVariable(int aTokenVal)
returns the current value of the @variable specified by the input parameter. |
protected java.util.Date |
getCreationTime()
|
int |
getDefaultBlockingStrategy()
returns the default blocking strategy for this session. |
int |
getDefaultLockStrategy()
returns the default locking strategy for this session. |
int |
getDefaultReleaseStrategy()
returns the default release strategy for this session. |
protected java.util.Date |
getFreedTime()
|
int |
getMaxOpenFiles()
returns the maximum number of UniFile objects we can open at any one time. |
int |
getNumOpenFiles()
returns the current number of open UniFile objects. |
protected boolean |
getPooledSession()
|
UniSSLDescriptor |
getSSLDescriptor()
|
int |
getSSLMode()
|
protected java.lang.String |
getValue(int key)
used to get a AT value from the server |
UniString |
iconv(java.lang.Object aString,
java.lang.Object aConvCode)
converts an input string into a UniVerse internal storage format using the conversion format specified. |
protected void |
initDefaultValues()
sets up the default values |
protected boolean |
isCommandActive()
checks to see if a command is in an active state |
protected boolean |
IsCPSupported(java.lang.String ServerId)
|
boolean |
isnSecure()
returns false if the session is SSL secure session; true otherwise |
UniNLSlocale |
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. |
UniNLSmap |
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. |
UniString |
oconv(java.lang.Object aString,
java.lang.Object aConvCode)
converts an output string into a UniVerse output storage format using the conversion format specified. |
UniFile |
open(java.lang.Object aFileName)
returns a new UniFile object. |
UniDictionary |
openDict(java.lang.Object aFileName)
returns a new UniDictionary object. |
UniFile |
openFile(java.lang.Object aFileName)
returns a new UniFile object. |
UniSequentialFile |
openSeq(java.lang.Object aFileName,
java.lang.Object aRecordID,
boolean aCreateFlag)
returns a new UniSequentialFile object. |
void |
releaseTaskLock(int aLockNum)
used to release a TaskLock that was set previously using the setTaskLock
method. |
UniSelectList |
selectList(int aSelectListNumber)
returns a newly created UniSelectList object |
void |
setAtVariable(int aTokenVal,
java.lang.Object aAtVariable)
sets the given @variable to the value passed in. |
void |
setCompressionThreshold(int aCompressionThresholdVal)
sets the current CompressionThreshold value. |
protected void |
setCreationTime(java.util.Date creationTime)
|
void |
setDefaultBlockingStrategy(int aBlockingStrategy)
sets the default blocking strategy |
void |
setDefaultEncryptionType(int aEncryptionType)
sets the current default encryption type to be used for this session. |
void |
setDefaultLockStrategy(int aLockingStrategy)
sets the default locking strategy |
void |
setDefaultReleaseStrategy(int aReleaseStrategy)
sets the default release strategy |
protected void |
setFreedTime(java.util.Date freedTime)
|
protected void |
setMarks(java.lang.String[] MarksArray)
Sets the MArks from NLSMap Object |
protected void |
setPooledSession(boolean pooledSession)
|
void |
setSSLDescriptor(UniSSLDescriptor ussld)
|
void |
setTaskLock(int aLockNum)
used to set on of the 64 UniVerse synchronization locks. |
void |
setTimeout(int aTimeoutVal)
Sets the UniRPC timeout value. |
int |
status()
returns information concerning the state of certain operations. |
UniSubroutine |
subroutine(java.lang.Object aSubName,
int aNumArgs)
returns a new UniSubroutine representing the new subroutine object created. |
UniTransaction |
transaction()
returns a new UniTransaction object to allow transactional control
of the session. |
UniXML |
xml()
returns a new UniXML representing the new xml object created. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected UniTransaction uniTransaction
protected UniCommand uniCommand
protected UniNLSlocale uniNLSLocale
protected UniNLSmap uniNLSMap
protected java.lang.String[] atVariableArray
Constructor Detail |
public UniSession()
UniRPCConnection
object.
public UniSession(UniSession aSession) throws UniSessionException
UniRPCConnection
object.
This version multiplexes the connection through an existing connection
aSession
- UniSession representing an existing active session
UniSessionException
- is thrown if an error occurspublic UniSession(int sslmode) throws UniSessionException
UniRPCConnection
object.
Allows to create secure SSL session by setting sslflag to true
Method Detail |
public java.lang.Object clone()
protected void finalize()
public UniCommand command() throws UniSessionException
UniSessionException
- is thrown if there is no active connection or if their is an error
establishing the UniCommand
objectpublic UniCommand command(java.lang.Object aCommandString) throws UniSessionException
aCommandString
- String representing the server-side command/stored procedure to be run. Performs
an automatic UniCommand.setCommand()
as a convenience.
UniSessionException
- is thrown if there is no active connection or if their is an error
establishing the UniCommand
objectprotected void connectInternal() throws UniSessionException
UniSessionException
public void connect() throws UniSessionException
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.
UniSessionException
- is thrown if the connection cannot be establishedUniConnection.setUserName(java.lang.Object)
,
UniConnection.setHostName(java.lang.String)
,
UniConnection.setHostPort(int)
,
UniConnection.setPassword(java.lang.Object)
,
UniConnection.setAccountPath(java.lang.Object)
,
UniConnection.setProxyHost(java.lang.Object)
,
UniConnection.setProxyPort(int)
,
UniConnection.setProxyToken(java.lang.Object)
public void connect(java.lang.Object aHost, java.lang.Object aUser, java.lang.Object aPass, java.lang.Object aPath) throws UniSessionException
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 machineaPath
- String representing the account path to log into on the server
machine
UniSessionException
- is thrown if the connection cannot be madepublic void connect(java.lang.Object aHost, int aPortNumber, java.lang.Object aUser, java.lang.Object aPass, java.lang.Object aPath) throws UniSessionException
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 toaUser
- String representing the user name on the server machine.aPass
- String representing the password on the server machineaPath
- String representing the account path to log into on the server machine
UniSessionException
- is thrown if the connection cannot be madepublic void connect(java.lang.Object aHost, java.lang.Object aUser, java.lang.Object aPass, java.lang.Object aPath, java.lang.Object aProxyHost, java.lang.Object aProxyToken) throws UniSessionException
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 machineaPath
- String representing the account path to log into on the server machineaProxyHost
- String representing the proxy host to connect to. Either the name
of the host or the IP address.aProxyToken
- string representing the Proxy password
UniSessionException
- is thrown if the connection cannot be madepublic void connect(java.lang.Object aHost, java.lang.Object aUser, java.lang.Object aPass, java.lang.Object aPath, java.lang.Object aProxyHost, int aProxyPort, java.lang.Object aProxyToken) throws UniSessionException
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 machineaPath
- String representing the account path to log into on the server machineaProxyHost
- String representing the proxy host to connect to. Either the name
of the host or the IP address.aProxyToken
- string representing the Proxy password
UniSessionException
- is thrown if the connection cannot be madepublic void connect(java.lang.Object aHost, int aHostPort, java.lang.Object aUser, java.lang.Object aPass, java.lang.Object aPath, java.lang.Object aProxyHost, java.lang.Object aProxyToken) throws UniSessionException
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 machineaPath
- String representing the account path to log into on the server machineaProxyHost
- String representing the proxy host to connect to. Either the name
of the host or the IP address.aProxyToken
- string representing the Proxy password
UniSessionException
- is thrown if the connection cannot be madepublic void disconnect() throws UniSessionException
UniSessionException
- occurs is an error occurs during the terminationconnect()
protected void disconnectServer() throws UniSessionException
UniSessionException
public UniDynArray dynArray()
public UniDynArray dynArray(java.lang.Object aString)
aString
- object by which the dynamic array will be initialized withpublic java.lang.String getAtVariable(int aTokenVal) throws UniSessionException
aTokenVal
- integer representing which @variable to return.
UniSessionException
- is thrown if an illegal argument is passed insetAtVariable(int, java.lang.Object)
public int getDefaultBlockingStrategy()
status
method to indicate the state of the
lock. This is the default value.
setDefaultBlockingStrategy(int)
public int getDefaultLockStrategy()
setDefaultLockStrategy(int)
public int getDefaultReleaseStrategy()
LockStrategy
.
requires an unlockRecord
method to unlock the record.
setRecordID
method.
setDefaultReleaseStrategy(int)
public int getMaxOpenFiles()
UniFile
objects we can open at any one time.
A return value of 0 means there is no limit.
public int getNumOpenFiles()
UniFile
objects.
UniFile
objectspublic UniSSLDescriptor getSSLDescriptor()
public UniString iconv(java.lang.Object aString, java.lang.Object aConvCode) throws UniStringException
status
function can be used
after this method to determine the status of the iconv
method.
aString
- input string that is to be convertedaConvCode
- conversion code used to convert the string
UniStringException
- is thrown if an error occursoconv(java.lang.Object, java.lang.Object)
,
status()
public boolean isnSecure()
public int getSSLMode()
public UniNLSlocale nlsLocale() throws UniSessionException
UniNLSlocale
object, which can then be used to manipulate server-side NLS Locale settings.
UniSessionException
- is thrown if an error occursnlsMap()
public UniNLSmap nlsMap() throws UniSessionException
UniNLSmap
object, which can then be used to manipulate server-side NLS Map settings.
UniSessionException
- is thrown if an error occursnlsLocale()
public UniString oconv(java.lang.Object aString, java.lang.Object aConvCode) throws UniStringException
status
function can be used
after this method to determine the status of the oconv
method.
aString
- input string that is to be convertedaConvCode
- conversion code used to convert the string
UniStringException
- is thrown if an error occursiconv(java.lang.Object, java.lang.Object)
,
status()
public UniFile openFile(java.lang.Object aFileName) throws UniSessionException
UniFile
object.
aFileName
- name of the universe file to be opened.
UniSessionException
- is thrown if there is an errorpublic UniFile open(java.lang.Object aFileName) throws UniSessionException
UniFile
object.
aFileName
- name of the universe file to be opened.
UniSessionException
- is thrown if there is an errorpublic UniDictionary openDict(java.lang.Object aFileName) throws UniSessionException
UniDictionary
object.
aFileName
- name of the universe dictionary file to be opened.
UniSessionException
- is thrown if there is an errorpublic UniSequentialFile openSeq(java.lang.Object aFileName, java.lang.Object aRecordID, boolean aCreateFlag) throws UniSessionException
UniSequentialFile
object.
aFileName
- name of the sequential file to be opened. A UniVerse Type 1 or 19 fileaRecordID
- refers to a record within the file, optionally created if it does not existaCreateFlag
- boolean denoting whether or not the file should be created if it does not exist.
UniSessionException
- is thrown if there is an errorpublic void releaseTaskLock(int aLockNum) throws UniSessionException
TaskLock
that was set previously using the setTaskLock
method.
aLockNum
- integer representing which of the 64 UniVerse task locks is to be set.
UniSessionException
- is thrown if an error occurs.setTaskLock(int)
public UniSelectList selectList(int aSelectListNumber) throws UniSessionException
UniSelectList
object
aSelectListNumber
- which UniVerse select list to create
UniSessionException
- is thrown if an error occurspublic void setAtVariable(int aTokenVal, java.lang.Object aAtVariable) throws UniSessionException
aTokenVal
- integer representing which @variable to setaAtVariable
- String representing the @variables new value
UniSessionException
- is thrown if an invalid aTokenVal is passed ingetAtVariable(int)
public void setCompressionThreshold(int aCompressionThresholdVal) throws UniSessionException
CompressionThreshold
value.
aCompressionThresholdVal
- integer representing the amount, in bytes, to set the compression
threshold to
UniSessionException
- is thrown if an invalid aCompressionThresholdVal is passed inpublic void setDefaultBlockingStrategy(int aBlockingStrategy) throws UniSessionException
aBlockingStrategy
- integer representing the default blocking strategy
UniSessionException
- is thrown if an invalid aBlockingStrategy is passed ingetDefaultBlockingStrategy()
public void setDefaultEncryptionType(int aEncryptionType) throws UniSessionException
aEncryptionType
- integer representing the type of encryption that is to be used.
UniSessionException
- is thrown if an invalid aType is passed inpublic void setDefaultLockStrategy(int aLockingStrategy) throws UniSessionException
aLockingStrategy
- integer representing the default locking strategy
UniSessionException
- is thrown if an invalid aLockingStrategy is passed ingetDefaultLockStrategy()
public void setDefaultReleaseStrategy(int aReleaseStrategy) throws UniSessionException
aReleaseStrategy
- integer representing the default release strategy
UniSessionException
- is thrown if an invalid aReleaseStrategy is passed ingetDefaultReleaseStrategy()
public void setSSLDescriptor(UniSSLDescriptor ussld)
public void setTaskLock(int aLockNum) throws UniSessionException
aLockNum
- integer representing which one of the 64 UniVerse synchronization locks is to be set
UniSessionException
- is thrown is an error occurs in obtaining the task lockreleaseTaskLock(int)
public void setTimeout(int aTimeoutVal) throws UniSessionException
aTimeoutVal
- integer representing the number of seconds the UniRPC should wait until it times out.
UniSessionException
- is thrown if the timeout cannot be setprotected void setMarks(java.lang.String[] MarksArray) throws UniSessionException
MarksArray
- integer representing the number of seconds the UniRPC should wait until it times out.
UniSessionException
- is thrown if the timeout cannot be setpublic int status()
connect()
public UniSubroutine subroutine(java.lang.Object aSubName, int aNumArgs) throws UniSessionException
UniSubroutine
representing the new subroutine object created.
aSubName
- String representing the name of the subroutine to be executed on the server.aNumArgs
- integer representing the number of arguments this subroutine has
UniSessionException
- is thrown if an error occurspublic UniXML xml() throws UniSessionException
UniXML
representing the new xml object created.
UniSessionException
- is thrown if an error occurspublic UniTransaction transaction() throws UniSessionException
UniTransaction
object to allow transactional control
of the session.
UniSessionException
- is thrown if an error occursprotected java.lang.String getValue(int key) throws UniSessionException
key
- integer representing the key value requested
UniSessionException
- is thrown if an error occursprotected boolean isCommandActive()
protected java.lang.Object clonePooled() throws UniSessionException
UniSessionException
protected boolean IsCPSupported(java.lang.String ServerId)
protected java.util.Date getCreationTime()
protected void setCreationTime(java.util.Date creationTime)
creationTime
- The creationTime to set.protected boolean getPooledSession()
protected void setPooledSession(boolean pooledSession)
pooledSession
- The pooledSession to set.protected java.util.Date getFreedTime()
protected void setFreedTime(java.util.Date freedTime)
freedTime
- The freedTime to set.protected void initDefaultValues()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |