All Packages Class Hierarchy This Package Previous Next Index
Class asjava.uniclientlibs.UniConnection
java.lang.Object
|
+----asjava.uniclientlibs.UniConnection
- public abstract class UniConnection
- extends Object
UniConnection
acts as the central object for any database connection,
controlling access to any network related elements. It controls information regarding
the connection. It cannot be instantiated by itself, but instead is used as the
foundation for other connection/session objects, such as the UniSession object.
- Version:
- Version 1.0
- Author:
- David T. Meeks
-
accountPath
-
-
compressionThreshold
-
-
connection
-
-
encryptionType
-
-
hostName
-
-
hostPort
-
-
hostType
-
-
inPacket
-
-
isActive
-
-
isNLSEnabled
-
-
isNLSLocalesEnabled
-
-
licenseToken
-
-
outPacket
-
-
password
-
-
proxyHost
-
-
proxyPort
-
-
proxySecurityToken
-
-
timeout
-
-
transport
-
-
uniConnectionString
-
-
uniDataSourceType
-
-
uniMarkCharacters
-
-
uniSubKey
-
-
userName
-
-
UniConnection()
-
-
encrypt(String)
- This method is used to encrypt a given string into an internal format that is understood by the
server
-
getAccountPath()
- returns the account path being used for the connection
-
getCompressionThreshold()
- returns the current
CompressionThreshold
.
-
getConnectionString()
- returns the current connection string, which is the string used to connect to
a particular database type.
-
getDataSourceType()
- returns the current data source type, which can be either "UNIVERSE" or "UNIDATA".
-
getDefaultEncryptionType()
- returns the current default encryption type to be used for this session.
-
getDeviceSubkey()
- gets the device subkey used in client-side licensing.
-
getHostName()
- returns the name of the host we are connecting to.
-
getHostPort()
- returns the port number used for this connection.
-
getHostType()
- returns a value representing the type of host the session is connected to.
-
getMarkCharacter(int)
- returns the specified mark characters.
-
getPassword()
- returns the password used to establish the connection to the host system
-
getProxyHost()
- returns the name of the
ProxyHost
being used for this connection
-
getProxyPort()
- returns the port number that the
ProxyHost
resides on
-
getProxyToken()
- returns the security string (password) used for validation on the
ProxyHost
-
getServerVersion()
- returns the current version of the host RPC version
-
getTimeout()
- returns the current RPC timeout period.
-
getTransport()
-
returns the type of network transport being used.
-
getUserName()
- returns the current user name used for this connection
-
isActive()
- boolean method that indicates
true
if a connection has been
successfully established.
-
isCompressionEnabled()
- boolean method that indicates
true
if a data compression is
available for this UniSession
.
-
isEncryptionEnabled()
- boolean method that indicates
true
if data encryption is available
for this UniSession
.
-
isNLSEnabled()
- boolean method that indicates
true
if the server this object is connected
to is currently NLS enabled.
-
isNLSLocalesEnabled()
- boolean method that indicates
true
if the server this object is connected
to is currently NLS locales enabled.
-
setAccountPath(Object)
- sets the account path to be used for the connection
-
setAccountPath(String)
- sets the account path to be used for the connection
-
setCompressionThresholdInt(int)
-
sets the current
CompressionThreshold
value.
-
setConnectionString(Object)
- sets connection string to be used for server connection
-
setConnectionString(String)
- sets connection string to be used for server connection
-
setDataSourceType(Object)
- sets data source type to connect to.
-
setDataSourceType(String)
- sets data source type to connect to.
-
setDefaultEncryptionTypeInt(int)
- sets the current default encryption type to be used for this session.
-
setDeviceSubkey(Object)
- sets up the device subkey for use in client-side licensing.
-
setHostName(Object)
- sets the host name to establish the connection to.
-
setHostName(String)
- sets the host name to establish the connection to.
-
setHostPort(int)
- sets the port number the connection should connect to on the server side.
-
setPassword(Object)
- sets the password to be used for the server-side connection
-
setPassword(String)
- sets the password to be used for the server-side connection
-
setProxyHost(Object)
- sets the host name of the ProxyServer to connect to
-
setProxyHost(String)
- sets the host name of the ProxyServer to connect to
-
setProxyPort(int)
-
sets the port number on the ProxyServer that should be used for the connection
-
setProxyToken(Object)
- sets the ProxyServer security token (password) to be used for connection validation
-
setTimeoutInt(int)
- Sets the UniRPC timeout value.
-
setTransport(int)
- Used to establish which type of network transport should be used.
-
setUserName(Object)
- sets the user name that is to be used in the connection to the remote server
connection
public UniRPCConnection connection
inPacket
protected UniRPCPacket inPacket
outPacket
protected UniRPCPacket outPacket
accountPath
protected String accountPath
hostName
protected String hostName
password
protected String password
userName
protected String userName
uniMarkCharacters
protected String uniMarkCharacters[]
uniConnectionString
protected String uniConnectionString
uniDataSourceType
protected String uniDataSourceType
proxyHost
protected String proxyHost
proxySecurityToken
protected String proxySecurityToken
licenseToken
protected String licenseToken
uniSubKey
protected String uniSubKey
hostPort
protected int hostPort
proxyPort
protected int proxyPort
transport
protected int transport
compressionThreshold
protected int compressionThreshold
timeout
protected int timeout
encryptionType
protected int encryptionType
hostType
protected int hostType
isNLSEnabled
protected boolean isNLSEnabled
isNLSLocalesEnabled
protected boolean isNLSLocalesEnabled
isActive
protected boolean isActive
UniConnection
public UniConnection()
getAccountPath
public String getAccountPath()
- returns the account path being used for the connection
- Returns:
- String representing the account path being used for the current connection.
- See Also:
- setAccountPath
getCompressionThreshold
public int getCompressionThreshold()
- returns the current
CompressionThreshold
. Whenever a data packet is transferred that exceeds the
CompressionThreshold
, it will be compressed using an internal compression algorithm. This will be
done for performance reasons. By default, it is set to 0, which represents no compression is to be done. Any
non-zero value will enable compression.
- Returns:
- integer representing the compression threshold, in bytes
getConnectionString
public String getConnectionString()
- returns the current connection string, which is the string used to connect to
a particular database type. For UniVerse, this will typically be "UVCS". This
value relates to what is in the uvrpcservices file on the server.
- Returns:
- String representing the current connection string
- See Also:
- setConnectionString
getDataSourceType
public String getDataSourceType()
- returns the current data source type, which can be either "UNIVERSE" or "UNIDATA".
- Returns:
- String representing the current data source type
- See Also:
- setDataSourceType
getDefaultEncryptionType
public int getDefaultEncryptionType()
- returns 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:
- NO_ENCRYPTION (0) - no encryption is to be done. This is the default value.
- INTERNAL_ENCRYPTION (1) - use UniVerse internal encryption.
/ul>
- Returns:
- integer representing the current default encryption type
- See Also:
- setDefaultEncryptionType
getDeviceSubkey
public String getDeviceSubkey()
- gets the device subkey used in client-side licensing. This is used to
establish differentiation between multiple applications running on the same
device, making connections to the same server. It allows a level of
connection pooling.
- Returns:
- String representing the subkey to be used
- See Also:
- setDeviceSubkey
getHostName
public String getHostName()
- returns the name of the host we are connecting to. It will return the value as specified in either the
setHostName
or connect
methods.
- Returns:
- String representing the host name we are connected to.
- See Also:
- setHostName
getHostPort
public int getHostPort()
- returns the port number used for this connection.
- Returns:
- integer representing the port number for this connection
- See Also:
- setHostPort
getHostType
public int getHostType()
- returns a value representing the type of host the session is connected to. Valid values are:
- UVT_NONE (0) - The host system cannot be determined, the session is not connected.
- UVT_UNIX (1) - The host is a UNIX system
- UVT_NT (2) - The host is a Windows NT system.
- Returns:
- integer representing the type of host we are connected to.
getServerVersion
public int getServerVersion()
- returns the current version of the host RPC version
- Returns:
- integer representing the current RPC version.
- a value of 1 represents an old server, where
- a value of 2 or greater represents a new server
- a value of -1 represents an error condition
getMarkCharacter
public String getMarkCharacter(int aMarkChar) throws UniConnectionException
- returns the specified mark characters. It will return the specified mark character based on the
following list:
- IM - Item Mark
- FM - Field Mark
- VM - Value Mark
- SVM - SubValue Mark
- TM - Text Mark
- SQLNULL - SQL Null Mark
- Parameters:
- aMarkChar - integer representing which character to obtain
- Returns:
- String representing the requested mark character
- Throws: UniConnectionException
- is thrown if an error occurs
getPassword
public String getPassword()
- returns the password used to establish the connection to the host system
- Returns:
- String representing the password being used for the connection
- See Also:
- setPassword
getProxyHost
public String getProxyHost()
- returns the name of the
ProxyHost
being used for this connection
- Returns:
- String representing the name of the
ProxyHost
- See Also:
- setProxyHost
getProxyPort
public int getProxyPort()
- returns the port number that the
ProxyHost
resides on
- Returns:
- integer representing the ProxyHost port number
- See Also:
- setProxyPort
getProxyToken
public String getProxyToken()
- returns the security string (password) used for validation on the
ProxyHost
- Returns:
- String representing the password used for ProxyHost validation
- See Also:
- setProxyToken
getTimeout
public int getTimeout()
- returns the current RPC timeout period. This value is used to timeout RPC requests.
The default value is 0, which means no timeout period.
- Returns:
- integer representing the current timeout interval for the RPC
getTransport
public int getTransport()
- returns the type of network transport being used. Currently, only TCP/IP is supported.
- Returns:
- integer representing the type of network transport being used.
- See Also:
- setTransport
getUserName
public String getUserName()
- returns the current user name used for this connection
- Returns:
- String representing the user name used for this connection
- See Also:
- setUserName
isActive
public boolean isActive()
- boolean method that indicates
true
if a connection has been
successfully established. It is false
if the connection has not
been established.
- Returns:
- boolean representing the state of the connection
isCompressionEnabled
public boolean isCompressionEnabled()
- boolean method that indicates
true
if a data compression is
available for this UniSession
. It is false
if the connection does not support data compression.
- Returns:
- boolean representing the availability of data compression
isEncryptionEnabled
public boolean isEncryptionEnabled()
- boolean method that indicates
true
if data encryption is available
for this UniSession
. It is false
if this session does not support encryption.
- Returns:
- boolean representing the availability of data encryption
isNLSEnabled
public boolean isNLSEnabled()
- boolean method that indicates
true
if the server this object is connected
to is currently NLS enabled. It will return false
if the server is not
NLS aware.
- Returns:
- boolean representing the state of NLS on the server
isNLSLocalesEnabled
public boolean isNLSLocalesEnabled()
- boolean method that indicates
true
if the server this object is connected
to is currently NLS locales enabled. It will return false
if the server is not
NLS locales aware.
- Returns:
- boolean representing the state of NLS locales on the server
setAccountPath
public void setAccountPath(Object aAccountPath)
- sets the account path to be used for the connection
- Parameters:
- aAccountPath - object representing which account to connect to
- See Also:
- getAccountPath
setAccountPath
public void setAccountPath(String aAccountPath)
- sets the account path to be used for the connection
- Parameters:
- aAccountPath - String representing which account to connect to
- See Also:
- getAccountPath
setCompressionThresholdInt
public void setCompressionThresholdInt(int aCompressionThresholdVal) throws UniConnectionException
- sets the current
CompressionThreshold
value.
- Parameters:
- aCompressionThresholdVal - integer representing the amount, in bytes, to set the compression
threshold to
- Throws: UniConnectionException
- is thrown if an invalid aCompressionThresholdVal is passed in
setConnectionString
public void setConnectionString(Object connString)
- sets connection string to be used for server connection
- Parameters:
- connString - object representing the connection string to be used.
- See Also:
- getConnectionString
setConnectionString
public void setConnectionString(String connString)
- sets connection string to be used for server connection
- Parameters:
- connString - string representing the connection string to be used.
- See Also:
- getConnectionString
setDataSourceType
public void setDataSourceType(Object dataSourceType) throws UniConnectionException
- sets data source type to connect to. By default, it's UNIVERSE. Changing this
value will also change the default connection string
- Parameters:
- dataSourceType - object representing the datasource type.
- Throws: UniConnectionException
- is thrown is an invalid data source type is specified
- See Also:
- getDataSourceType
setDataSourceType
public void setDataSourceType(String dataSourceType) throws UniConnectionException
- sets data source type to connect to. By default, it's UNIVERSE. Changing this
value will also change the default connection string
- Parameters:
- dataSourceType - string representing the datasource type.
- Throws: UniConnectionException
- is thrown is an invalid data source type is specified
- See Also:
- getDataSourceType
setDefaultEncryptionTypeInt
public void setDefaultEncryptionTypeInt(int aType) throws UniConnectionException
- 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:
- NO_ENCRYPTION (0) - no encryption is to be done. This is the default value.
- INTERNAL_ENCRYPTION (1) - use UniVerse internal encryption.
/ul>
- Parameters:
- aType - integer representing the type of encryption that is to be used.
- Throws: UniConnectionException
- is thrown if an invalid aType is passed in
setDeviceSubkey
public void setDeviceSubkey(Object subKey)
- sets up the device subkey for use in client-side licensing. This is used to
establish differentiation between multiple applications running on the same
device, making connections to the same server. It allows a level of
connection pooling.
- Parameters:
- subKey - String representing the subkey to be used
- See Also:
- getDeviceSubkey
setHostName
public void setHostName(String aHostName)
- sets the host name to establish the connection to.
- Parameters:
- aHostName - String representing the name of the host to connect to
- See Also:
- getHostName
setHostName
public void setHostName(Object aHostName)
- sets the host name to establish the connection to.
- Parameters:
- aHostName - object representing the name of the host to connect to
- See Also:
- getHostName
setHostPort
public void setHostPort(int aHostPort)
- sets the port number the connection should connect to on the server side.
- Parameters:
- aHostPort - integer representing the hostside port number to connect to
- See Also:
- getHostPort
setPassword
public void setPassword(Object aPassword)
- sets the password to be used for the server-side connection
- Parameters:
- aPassword - object representing the password to be used for the connection
- See Also:
- getPassword
setPassword
public void setPassword(String aPassword)
- sets the password to be used for the server-side connection
- Parameters:
- aPassword - String representing the password to be used for the connection
- See Also:
- getPassword
setProxyHost
public void setProxyHost(Object aProxyHost)
- sets the host name of the ProxyServer to connect to
- Parameters:
- aProxyHost - object representing the name of the ProxyServer to connect to
- See Also:
- getProxyHost
setProxyHost
public void setProxyHost(String aProxyHost)
- sets the host name of the ProxyServer to connect to
- Parameters:
- aProxyHost - String representing the name of the ProxyServer to connect to
- See Also:
- getProxyHost
setProxyPort
public void setProxyPort(int aProxyPort)
- sets the port number on the ProxyServer that should be used for the connection
- Parameters:
- aProxyPort - integer reprenting the port number that should be used for the connection
to the ProxyServer.
- See Also:
- getProxyPort
setProxyToken
public void setProxyToken(Object aProxyToken)
- sets the ProxyServer security token (password) to be used for connection validation
- Parameters:
- aProxyToken - String representing the secutiry token (password) to be used for connection validation
- See Also:
- getProxyToken
setTimeoutInt
public void setTimeoutInt(int aTimeoutVal) throws UniConnectionException
- 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: UniConnectionException
- is thrown if the timeout cannot be set
setTransport
public void setTransport(int aTransportType)
- Used to establish which type of network transport should be used. The only currently supported network
transport mechanism is TCP/IP
- Parameters:
- aTransportType - integer representing the type of network transport should be used.
- See Also:
- getTransport
setUserName
public void setUserName(Object aUserName)
- sets the user name that is to be used in the connection to the remote server
- Parameters:
- aUserName - String representing the server-side username used for connection purposes.
- See Also:
- getUserName, connect
encrypt
protected String encrypt(String aString)
- This method is used to encrypt a given string into an internal format that is understood by the
server
All Packages Class Hierarchy This Package Previous Next Index