com.genesyslab.omsdk.commons
Class InitializationParameters

java.lang.Object
  extended bycom.genesyslab.omsdk.commons.InitializationParameters

public class InitializationParameters
extends java.lang.Object

Placeholder for the parameters required to initialize the library.

Use this class as shown in this code snippet.

Since:
7.1.008.00
See Also:
OMSDKConnector.initialize(InitializationParameters)

Constructor Summary
InitializationParameters(java.lang.String primaryHost, int primaryPort, java.lang.String backupHost, int backupPort, java.lang.String applicationName, ApplicationType applicationType, int reconnectionPeriod, int reconnectionAttempts)
          Constructor with required parameters for connecting to the primary and backup Configuration Layers.
InitializationParameters(java.lang.String primaryHost, int primaryPort, java.lang.String backupHost, int backupPort, java.lang.String applicationName, int reconnectionPeriod, int reconnectionAttempts)
          Deprecated. Deprecated. Application type should be provided explicitly. Use #InitializationParameters(String, int, String, int, String, int, int, int) instead
 
Method Summary
 void addInitializationServices(InitializationServices services)
          Adds the services that the OMSDKConnector component initializes.
 java.lang.Object clone()
          Creates and returns a copy of this object.
 java.lang.String getApplicationName()
          Returns the name of the entry defined in the Configuration Layer for this application.
 int getApplicationType()
           
 java.lang.String getBackupHost()
          Returns the Configuration Layer's backup host.
 int getBackupPort()
          Returns the Configuration Layer's backup port.
 java.lang.String getPrimaryHost()
          Returns the Configuration Layer's primary host.
 int getPrimaryPort()
          Returns the Configuration Layer's primary port.
 int getReconnectionAttempts()
          Returns the number of possible reconnection attempts.
 int getReconnectionPeriod()
          Returns the period, in milliseconds, between two reconnection attempts.
 java.util.Set getServices()
          Returns the services used for initializing the OMSDKConnector.
 java.lang.String getStartupLogFilePath()
          Returns the path to the log file.
 boolean isStartupConsoleTraceOn()
          Returns whether or not the log console is enabled.
 boolean isStartupFileTraceOn()
          Returns whether or not the log file is enabled.
 void setStartupConsoleTraceOn(boolean startupConsoleTraceOn)
          Enables or disables the log console.
 void setStartupFileTraceOn(boolean startupFileTraceOn)
          Enables or disables the log file.
 void setStartupLogFilePath(java.lang.String startupLogFilePath)
          Sets the path to the log file.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitializationParameters

public InitializationParameters(java.lang.String primaryHost,
                                int primaryPort,
                                java.lang.String backupHost,
                                int backupPort,
                                java.lang.String applicationName,
                                int reconnectionPeriod,
                                int reconnectionAttempts)
Deprecated. Deprecated. Application type should be provided explicitly. Use #InitializationParameters(String, int, String, int, String, int, int, int) instead

Constructor with required parameters for connecting to the primary and backup Configuration Layers.

Parameters:
primaryHost - host name of the primary Configuration Layer to which the library connects.
primaryPort - port number of the primary Configuration Layer to which the library connects.
backupHost - host name of the backup Configuration Layer to which the library connects. Can be null if there is no backup server.
backupPort - port number of the backup Configuration Layer to which the library connects. Can be null. Considered only if the backupHost parameter is not null.
applicationName - name of the application entry in the Configuration Layer.
reconnectionPeriod - period, in milliseconds, between reconnection attempts.
Effective for all back-end services connections.
reconnectionAttempts - number of reconnection attempts.
Effective for all back-end service connections. In the event of a connection loss, the application will attempt to reconnect until this number is reached or until the library is stopped.

InitializationParameters

public InitializationParameters(java.lang.String primaryHost,
                                int primaryPort,
                                java.lang.String backupHost,
                                int backupPort,
                                java.lang.String applicationName,
                                ApplicationType applicationType,
                                int reconnectionPeriod,
                                int reconnectionAttempts)
Constructor with required parameters for connecting to the primary and backup Configuration Layers.

Parameters:
primaryHost - host name of the primary Configuration Layer to which the library connects.
primaryPort - port number of the primary Configuration Layer to which the library connects.
backupHost - host name of the backup Configuration Layer to which the library connects. Can be null if there is no backup server.
backupPort - port number of the backup Configuration Layer to which the library connects. Can be null. Considered only if the backupHost parameter is not null.
applicationName - name of the application entry in the Configuration Layer.
applicationType - type of the application entry in the Configuration Layer.
reconnectionPeriod - period, in milliseconds, between reconnection attempts.
Effective for all back-end services connections.
reconnectionAttempts - number of reconnection attempts.
Effective for all back-end service connections. In the event of a connection loss, the application will attempt to reconnect until this number is reached or until the library is stopped. *
Method Detail

getApplicationName

public java.lang.String getApplicationName()
Returns the name of the entry defined in the Configuration Layer for this application.

Returns:
name of the application's entry.

getPrimaryHost

public java.lang.String getPrimaryHost()
Returns the Configuration Layer's primary host.

Returns:
the Configuration Layer's primary host.

getPrimaryPort

public int getPrimaryPort()
Returns the Configuration Layer's primary port.

Returns:
the Configuration Layer's primary port.

getBackupHost

public java.lang.String getBackupHost()
Returns the Configuration Layer's backup host.

Returns:
the Configuration Layer's backup host.

getBackupPort

public int getBackupPort()
Returns the Configuration Layer's backup port.

Returns:
the Configuration Layer's backup port.

getReconnectionPeriod

public int getReconnectionPeriod()
Returns the period, in milliseconds, between two reconnection attempts.

Note: Effective for connection to the Configuration Layer and Interaction Server.

Returns:
period, in milliseconds, between two reconnection attempts in milliseconds.

getReconnectionAttempts

public int getReconnectionAttempts()
Returns the number of possible reconnection attempts.

Note: Effective for all back-end service connections. In the event of a connection loss, the application will attempt to reconnect until this number is reached or until the library is stopped.

Returns:
number of possible reconnection attempts.

getServices

public java.util.Set getServices()
Returns the services used for initializing the OMSDKConnector.

Returns:
Set of ServiceType items.

addInitializationServices

public void addInitializationServices(InitializationServices services)
Adds the services that the OMSDKConnector component initializes.

Parameters:
services - services to add

isStartupConsoleTraceOn

public boolean isStartupConsoleTraceOn()
Returns whether or not the log console is enabled.

Returns:
true if the log console is enabled.
Since:
7.1.010.00

setStartupConsoleTraceOn

public void setStartupConsoleTraceOn(boolean startupConsoleTraceOn)
Enables or disables the log console.

Parameters:
startupConsoleTraceOn - true to enable the log console.
Since:
7.1.010.00

isStartupFileTraceOn

public boolean isStartupFileTraceOn()
Returns whether or not the log file is enabled.

Returns:
true if file log is enabled
Since:
7.1.010.00

setStartupFileTraceOn

public void setStartupFileTraceOn(boolean startupFileTraceOn)
Enables or disables the log file.

Parameters:
startupFileTraceOn - true to enable the log file.
Since:
7.1.010.00

getStartupLogFilePath

public java.lang.String getStartupLogFilePath()
Returns the path to the log file.
By default, the "omsdk_startup.log" is returned

Returns:
the path to the log file.
Since:
7.1.010.00

setStartupLogFilePath

public void setStartupLogFilePath(java.lang.String startupLogFilePath)
Sets the path to the log file. If you do not set a path for the log file, the "omsdk_startup.log" is used.

Parameters:
startupLogFilePath - the path to the log file.
Since:
7.1.010.00

clone

public java.lang.Object clone()
Creates and returns a copy of this object.

Returns:
cloned object

toString

public java.lang.String toString()
Returns a string representation of the object.


getApplicationType

public int getApplicationType()