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

Variable Index

 o accountPath
 o compressionThreshold
 o connection
 o encryptionType
 o hostName
 o hostPort
 o hostType
 o inPacket
 o isActive
 o isNLSEnabled
 o isNLSLocalesEnabled
 o licenseToken
 o outPacket
 o password
 o proxyHost
 o proxyPort
 o proxySecurityToken
 o timeout
 o transport
 o uniConnectionString
 o uniDataSourceType
 o uniMarkCharacters
 o uniSubKey
 o userName

Constructor Index

 o UniConnection()

Method Index

 o encrypt(String)
This method is used to encrypt a given string into an internal format that is understood by the server
 o getAccountPath()
returns the account path being used for the connection
 o getCompressionThreshold()
returns the current CompressionThreshold.
 o getConnectionString()
returns the current connection string, which is the string used to connect to a particular database type.
 o getDataSourceType()
returns the current data source type, which can be either "UNIVERSE" or "UNIDATA".
 o getDefaultEncryptionType()
returns the current default encryption type to be used for this session.
 o getDeviceSubkey()
gets the device subkey used in client-side licensing.
 o getHostName()
returns the name of the host we are connecting to.
 o getHostPort()
returns the port number used for this connection.
 o getHostType()
returns a value representing the type of host the session is connected to.
 o getMarkCharacter(int)
returns the specified mark characters.
 o getPassword()
returns the password used to establish the connection to the host system
 o getProxyHost()
returns the name of the ProxyHost being used for this connection
 o getProxyPort()
returns the port number that the ProxyHost resides on
 o getProxyToken()
returns the security string (password) used for validation on the ProxyHost
 o getServerVersion()
returns the current version of the host RPC version
 o getTimeout()
returns the current RPC timeout period.
 o getTransport()
returns the type of network transport being used.
 o getUserName()
returns the current user name used for this connection
 o isActive()
boolean method that indicates true if a connection has been successfully established.
 o isCompressionEnabled()
boolean method that indicates true if a data compression is available for this UniSession.
 o isEncryptionEnabled()
boolean method that indicates true if data encryption is available for this UniSession.
 o isNLSEnabled()
boolean method that indicates true if the server this object is connected to is currently NLS enabled.
 o isNLSLocalesEnabled()
boolean method that indicates true if the server this object is connected to is currently NLS locales enabled.
 o setAccountPath(Object)
sets the account path to be used for the connection
 o setAccountPath(String)
sets the account path to be used for the connection
 o setCompressionThresholdInt(int)
sets the current CompressionThreshold value.
 o setConnectionString(Object)
sets connection string to be used for server connection
 o setConnectionString(String)
sets connection string to be used for server connection
 o setDataSourceType(Object)
sets data source type to connect to.
 o setDataSourceType(String)
sets data source type to connect to.
 o setDefaultEncryptionTypeInt(int)
sets the current default encryption type to be used for this session.
 o setDeviceSubkey(Object)
sets up the device subkey for use in client-side licensing.
 o setHostName(Object)
sets the host name to establish the connection to.
 o setHostName(String)
sets the host name to establish the connection to.
 o setHostPort(int)
sets the port number the connection should connect to on the server side.
 o setPassword(Object)
sets the password to be used for the server-side connection
 o setPassword(String)
sets the password to be used for the server-side connection
 o setProxyHost(Object)
sets the host name of the ProxyServer to connect to
 o setProxyHost(String)
sets the host name of the ProxyServer to connect to
 o setProxyPort(int)
sets the port number on the ProxyServer that should be used for the connection
 o setProxyToken(Object)
sets the ProxyServer security token (password) to be used for connection validation
 o setTimeoutInt(int)
Sets the UniRPC timeout value.
 o setTransport(int)
Used to establish which type of network transport should be used.
 o setUserName(Object)
sets the user name that is to be used in the connection to the remote server

Variables

 o connection
 public UniRPCConnection connection
 o inPacket
 protected UniRPCPacket inPacket
 o outPacket
 protected UniRPCPacket outPacket
 o accountPath
 protected String accountPath
 o hostName
 protected String hostName
 o password
 protected String password
 o userName
 protected String userName
 o uniMarkCharacters
 protected String uniMarkCharacters[]
 o uniConnectionString
 protected String uniConnectionString
 o uniDataSourceType
 protected String uniDataSourceType
 o proxyHost
 protected String proxyHost
 o proxySecurityToken
 protected String proxySecurityToken
 o licenseToken
 protected String licenseToken
 o uniSubKey
 protected String uniSubKey
 o hostPort
 protected int hostPort
 o proxyPort
 protected int proxyPort
 o transport
 protected int transport
 o compressionThreshold
 protected int compressionThreshold
 o timeout
 protected int timeout
 o encryptionType
 protected int encryptionType
 o hostType
 protected int hostType
 o isNLSEnabled
 protected boolean isNLSEnabled
 o isNLSLocalesEnabled
 protected boolean isNLSLocalesEnabled
 o isActive
 protected boolean isActive

Constructors

 o UniConnection
 public UniConnection()

Methods

 o 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
 o 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
 o 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
 o 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
 o 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:
 o 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
 o 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
 o getHostPort
 public int getHostPort()
returns the port number used for this connection.

Returns:
integer representing the port number for this connection
See Also:
setHostPort
 o getHostType
 public int getHostType()
returns a value representing the type of host the session is connected to. Valid values are:

Returns:
integer representing the type of host we are connected to.
 o 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
 o 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:

Parameters:
aMarkChar - integer representing which character to obtain
Returns:
String representing the requested mark character
Throws: UniConnectionException
is thrown if an error occurs
 o 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
 o 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
 o getProxyPort
 public int getProxyPort()
returns the port number that the ProxyHost resides on

Returns:
integer representing the ProxyHost port number
See Also:
setProxyPort
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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:
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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