com.softwareag.tamino.db.api.common
Class TPreference

java.lang.Object
  extended by com.softwareag.tamino.db.api.common.TPreference

public class TPreference
extends java.lang.Object

TPreference serves as a unique repository of state for the Tamino API. Common information, here defined as preferences, that have to be available throughout the API are stored within TPreference. This class is implemented according the singleton design pattern thus only one instance is available. Currently encoding is the only preference that is available. The states of TPreference may be overwritten with key and value pairs of the system properties so that is possible to modify the states from the start of the JVM.

Version:
$Revision: 1.35 $
Author:
Marcus Schreyer

Field Summary
static java.lang.String ACCEPT_ENCODING
          The key for the Accept-Encoding preference.
static java.lang.String CHECK_SERVER_AVAILABILITY
          The boooelan key that indicates whether the server availability will be checked for each new TConnection.
static java.lang.String DEFAULT_OBJECT_MODEL
          The key for the default object model.
static java.lang.String DISABLE_INO_DEFINATION
          The pattern to configure the output string used by the duration logging for the messages.
static java.lang.String DURATION_LOGGING
          Indicates whether duration logging is enabled in generally when starting.
static java.lang.String DURATION_LOGGING_LEVEL
          The level used by the duration logging for the messages sent to the underlying log4j logger.
static java.lang.String DURATION_LOGGING_PATTERN
          The pattern to configure the output string used by the duration logging for the messages.
static java.lang.String ENCODING
          The key for the Encoding preference.
static java.lang.String GET_SERVER_VERSION
          The boooelan key that indicates whether the server version will be checked for each TSystemAccessor.getServerVersion.
static java.lang.String HTTP_URL_CONNECTION_AUTO_DISCONNECT
          The key that indicates whether a HTTPUrlConnection will be disconnected() automatically, ie.
static java.lang.String INVOCATION_MODIFIER
          The key that indicates the use of an alternate invocation handler to be used.
static java.lang.String IS_OPTIMIZATION_ON
          The boooelan key that indicates whether optimizations will be made.
static java.lang.String LOCAL_TRANSACTION_CONNECT_MODE
          The key that indicates the kind of connect command value that will be used when connecting to a local transaction.
static java.lang.String USE_APACHE_LOAD_EXTRNAL_DTD
          The key for the apache load external dtd feature.
static java.lang.String USE_INVALIDATABLE_ACCESSORS
          The key that indicates if invalidatable accessors should generally be used.
static java.lang.String USE_RETRY_HANDLER
          The key that indicates if retry handlers are used.
static java.lang.String USERID_DOMAIN_SEPARATOR
          The key that indicates the kind of separation character used to serarate userID and domain name for ahthentication.
 
Method Summary
 java.lang.String getAcceptEncoding()
          Gets the ACCEPT_ENCODING HTTP Header property.
 boolean getAutoDisconnectHttpUrlConnection()
          Gets the �auto� disconnect property for an HttpUrlConnection.
 boolean getCheckServerAvailability()
          Gets the �check server availablity� property.
 int getDefaultBufferSize()
          Gets the default buffer size that can be used for any type of action that needs to use a buffer of variabel size.
 java.lang.Object getDefaultObjectModel()
          Gets the default object model that is currently set.
 boolean getDisableINO()
          Gets the disable ino definations property.
 java.lang.String getDurationLogging()
          Gets the duration logging property.
 java.lang.String getDurationLoggingLevel()
          Gets the duration logging level property.
 java.lang.String getDurationLoggingPattern()
          Gets the duration logging pattern property.
 java.lang.String getEncoding()
          Gets the encoding preference.
 boolean getGetServerVersion()
          Gets the �get server version� property.
static TPreference getInstance()
          Gets the singleton instance.
 java.lang.String getInvocationModifier()
          Gets the invocation modifier needed to handle alternate invocation handlers for the same protocol.
 boolean getIsOptimizationOn()
          Gets the �is optimization on� property.
 java.lang.String getLocalTransactionConnectMode()
          Get the connect command value that will be used when connecting to a local transaction.
 java.lang.String getUserIdDomainSeparator()
          Gets the separator character used to serarate userID and domain name for ahthentication
 void setAcceptEncoding(java.lang.String acceptEncoding)
          Sets the ACCEPT_ENCODING HTTP Header property.
 void setAutoDisconnectHttpUrlConnection(boolean autoDisconnect)
          Sets the �auto� disconnect property for an HttpUrlConnection.
 void setCheckServerAvailability(boolean checkEachConnection)
          If true each TConnection.newConnection() tries to reach the server with a PING.
 void setDisableINO(boolean state)
          Sets the disable ino definations property.
 void setDurationLogging(java.lang.String logging)
          Sets the duration logging property.
 void setDurationLoggingLevel(java.lang.String level)
          Sets the duration logging level property.
 void setDurationLoggingPattern(java.lang.String pattern)
          Sets the duration logging pattern property.
 void setGetServerVersion(boolean getOnEachCall)
          If true each TSystemAccessor.getServerVersion() performs a version command on Tamino to retrieve the version number.Connection.newConnection() tries to reach the server with a PING.
 void setInvocationModifier(java.lang.String modifier)
          Gets the invocation modifier needed to handle alternate invocation handlers for the same protocol.
 void setIsOptimizationOn(boolean on)
          If true the API will try to perform optimizations.
 void setLocalTransactionConnectMode(java.lang.String localTransactionConnectMode)
          Set the connect command value that will be used when connecting to a local transaction.
 void setUseApacheLoadExternalDTD(boolean useApacheLoadExternalDTD)
          Set the apache load external DTD feature.
 void setUseInvalidatableAccessorsIsEnabled(boolean useInvalidatableAccessors)
          Deprecated. This is no longer neccessary since every accessor is now �invalidatable�.
 void setUseRetryHandler(boolean useRetryHandler)
          Set the use of retry handler.
 boolean useApacheLoadExternalDTD()
          Indicates if the apache load external DTD feature shall be used or not!
 boolean useInvalidatableAccessorsIsEnabled()
          Deprecated. This is no longer neccessary since every accessor is now �invalidatable�.
 boolean useRetryHandler()
          Indicates if the use of retry handler has been enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_APACHE_LOAD_EXTRNAL_DTD

public static final java.lang.String USE_APACHE_LOAD_EXTRNAL_DTD
The key for the apache load external dtd feature.

See Also:
Constant Field Values

ENCODING

public static final java.lang.String ENCODING
The key for the Encoding preference.

See Also:
Constant Field Values

ACCEPT_ENCODING

public static final java.lang.String ACCEPT_ENCODING
The key for the Accept-Encoding preference.

See Also:
Constant Field Values

DEFAULT_OBJECT_MODEL

public static final java.lang.String DEFAULT_OBJECT_MODEL
The key for the default object model.

See Also:
Constant Field Values

USE_INVALIDATABLE_ACCESSORS

public static final java.lang.String USE_INVALIDATABLE_ACCESSORS
The key that indicates if invalidatable accessors should generally be used.

See Also:
Constant Field Values

USE_RETRY_HANDLER

public static final java.lang.String USE_RETRY_HANDLER
The key that indicates if retry handlers are used.

See Also:
Constant Field Values

INVOCATION_MODIFIER

public static final java.lang.String INVOCATION_MODIFIER
The key that indicates the use of an alternate invocation handler to be used.

See Also:
Constant Field Values

USERID_DOMAIN_SEPARATOR

public static final java.lang.String USERID_DOMAIN_SEPARATOR
The key that indicates the kind of separation character used to serarate userID and domain name for ahthentication.

See Also:
Constant Field Values

LOCAL_TRANSACTION_CONNECT_MODE

public static final java.lang.String LOCAL_TRANSACTION_CONNECT_MODE
The key that indicates the kind of connect command value that will be used when connecting to a local transaction.

See Also:
Constant Field Values

HTTP_URL_CONNECTION_AUTO_DISCONNECT

public static final java.lang.String HTTP_URL_CONNECTION_AUTO_DISCONNECT
The key that indicates whether a HTTPUrlConnection will be disconnected() automatically, ie. as fast as possible or never.

See Also:
Constant Field Values

CHECK_SERVER_AVAILABILITY

public static final java.lang.String CHECK_SERVER_AVAILABILITY
The boooelan key that indicates whether the server availability will be checked for each new TConnection.

See Also:
Constant Field Values

GET_SERVER_VERSION

public static final java.lang.String GET_SERVER_VERSION
The boooelan key that indicates whether the server version will be checked for each TSystemAccessor.getServerVersion.

See Also:
Constant Field Values

IS_OPTIMIZATION_ON

public static final java.lang.String IS_OPTIMIZATION_ON
The boooelan key that indicates whether optimizations will be made.

See Also:
Constant Field Values

DURATION_LOGGING

public static final java.lang.String DURATION_LOGGING
Indicates whether duration logging is enabled in generally when starting.

See Also:
Constant Field Values

DURATION_LOGGING_LEVEL

public static final java.lang.String DURATION_LOGGING_LEVEL
The level used by the duration logging for the messages sent to the underlying log4j logger.

See Also:
Constant Field Values

DURATION_LOGGING_PATTERN

public static final java.lang.String DURATION_LOGGING_PATTERN
The pattern to configure the output string used by the duration logging for the messages.

See Also:
Constant Field Values

DISABLE_INO_DEFINATION

public static final java.lang.String DISABLE_INO_DEFINATION
The pattern to configure the output string used by the duration logging for the messages.

See Also:
Constant Field Values
Method Detail

getInstance

public static TPreference getInstance()
Gets the singleton instance.


getEncoding

public java.lang.String getEncoding()
Gets the encoding preference.


getDefaultObjectModel

public java.lang.Object getDefaultObjectModel()
Gets the default object model that is currently set. Please note that the object model is handed back as an Object thus the client is responsible to downcast it.


getDefaultBufferSize

public int getDefaultBufferSize()
Gets the default buffer size that can be used for any type of action that needs to use a buffer of variabel size.


getInvocationModifier

public java.lang.String getInvocationModifier()
Gets the invocation modifier needed to handle alternate invocation handlers for the same protocol.


setInvocationModifier

public void setInvocationModifier(java.lang.String modifier)
Gets the invocation modifier needed to handle alternate invocation handlers for the same protocol.


useInvalidatableAccessorsIsEnabled

public boolean useInvalidatableAccessorsIsEnabled()
Deprecated. This is no longer neccessary since every accessor is now �invalidatable�.

Indicates if the use of invalidatable accessors has been enabled.


useApacheLoadExternalDTD

public boolean useApacheLoadExternalDTD()
Indicates if the apache load external DTD feature shall be used or not!

Returns:
boolean see above

useRetryHandler

public boolean useRetryHandler()
Indicates if the use of retry handler has been enabled.


setUseInvalidatableAccessorsIsEnabled

public void setUseInvalidatableAccessorsIsEnabled(boolean useInvalidatableAccessors)
Deprecated. This is no longer neccessary since every accessor is now �invalidatable�.

Set the use of invalidatable accessors.

Parameters:
useInvalidatableAccessors - true/false

setUseApacheLoadExternalDTD

public void setUseApacheLoadExternalDTD(boolean useApacheLoadExternalDTD)
Set the apache load external DTD feature.

Parameters:
useApacheLoadExternalDTD - true/false

setUseRetryHandler

public void setUseRetryHandler(boolean useRetryHandler)
Set the use of retry handler.


getUserIdDomainSeparator

public java.lang.String getUserIdDomainSeparator()
Gets the separator character used to serarate userID and domain name for ahthentication


setLocalTransactionConnectMode

public void setLocalTransactionConnectMode(java.lang.String localTransactionConnectMode)
Set the connect command value that will be used when connecting to a local transaction.

Parameters:
localTransactionConnectMode - the connect command value as a string. e.g. "migrate".

getLocalTransactionConnectMode

public java.lang.String getLocalTransactionConnectMode()
Get the connect command value that will be used when connecting to a local transaction.

Returns:
the connect command value, null indicates the default.

setAutoDisconnectHttpUrlConnection

public void setAutoDisconnectHttpUrlConnection(boolean autoDisconnect)
Sets the �auto� disconnect property for an HttpUrlConnection. If set to true the API will disconnect() each HttpUrlConnection as fast as possible. This may slow down communication but may slow down the communication.

Parameters:
autoDisconnect - disconnect a used HttpUrlConnection or not.

getAutoDisconnectHttpUrlConnection

public boolean getAutoDisconnectHttpUrlConnection()
Gets the �auto� disconnect property for an HttpUrlConnection.

Returns:
the disconnect property.

setCheckServerAvailability

public void setCheckServerAvailability(boolean checkEachConnection)
If true each TConnection.newConnection() tries to reach the server with a PING. If false is specified the check will only be done once for a database uri!!

Parameters:
checkEachConnection - check each Connection or not.

getCheckServerAvailability

public boolean getCheckServerAvailability()
Gets the �check server availablity� property.

Returns:
the check server availablity property.

setGetServerVersion

public void setGetServerVersion(boolean getOnEachCall)
If true each TSystemAccessor.getServerVersion() performs a version command on Tamino to retrieve the version number.Connection.newConnection() tries to reach the server with a PING. If false is specified the this will only be done once for a database uri!!

Parameters:
getOnEachCall - get on each Call.

getGetServerVersion

public boolean getGetServerVersion()
Gets the �get server version� property.

Returns:
the get server version property.

setIsOptimizationOn

public void setIsOptimizationOn(boolean on)
If true the API will try to perform optimizations.

Parameters:
on - true try, otherwise do nothing special.

getIsOptimizationOn

public boolean getIsOptimizationOn()
Gets the �is optimization on� property.

Returns:
the is optimization on property.

setDurationLogging

public void setDurationLogging(java.lang.String logging)
Sets the duration logging property.

Parameters:
logging - the duration logging property

getDurationLogging

public java.lang.String getDurationLogging()
Gets the duration logging property.

Returns:
the duration logging property.

setDurationLoggingLevel

public void setDurationLoggingLevel(java.lang.String level)
Sets the duration logging level property.

Parameters:
level - the duration logging level property

getDurationLoggingLevel

public java.lang.String getDurationLoggingLevel()
Gets the duration logging level property.

Returns:
the duration logging level property.

setDurationLoggingPattern

public void setDurationLoggingPattern(java.lang.String pattern)
Sets the duration logging pattern property.

Parameters:
pattern - the duration logging pattern property

getDurationLoggingPattern

public java.lang.String getDurationLoggingPattern()
Gets the duration logging pattern property.

Returns:
the duration logging pattern property.

setDisableINO

public void setDisableINO(boolean state)
Sets the disable ino definations property.

Parameters:
state - - defines the status of ino definations

getDisableINO

public boolean getDisableINO()
Gets the disable ino definations property.

Returns:
the status of ino definations.

setAcceptEncoding

public void setAcceptEncoding(java.lang.String acceptEncoding)
Sets the ACCEPT_ENCODING HTTP Header property.

Parameters:
state - - defines the status of ACCEPT_ENCODING

getAcceptEncoding

public java.lang.String getAcceptEncoding()
Gets the ACCEPT_ENCODING HTTP Header property.

Returns:
the status of ACCEPT_ENCODING


Copyright (c) 2013 Software AG. All Rights Reserved.