com.highdeal.cnd.message
Class ServiceClientTuning

java.lang.Object
  extended by com.highdeal.cnd.message.ServiceClientTuning
Direct Known Subclasses:
StatefulServiceClientTuning

public class ServiceClientTuning
extends java.lang.Object

This class is a set of tuning properties for the service client.

Notice modified these properties can prevent the client to start or make the High Availability process unstable. Ensure that you understand the consequences of your modification, contact your SAP Support Team for further information.


Field Summary
static int CONNECT_TIMEOUT
          Constant describing the default value for the connect timeout; Default is 10,000 ms.
static int HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT
          Constant describing the default value of the heartbeat activation period count; Default is 1.
static int HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT
          Constant describing the default value of the heartbeat dead connection period count; Default is 2.
static int HEARTBEAT_DEFAULT_POLLING_PERIOD
          Constant describing the default polling period of the heartbeat; Default is 2,000 milliseconds.
static int SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT
          Constant describing the default maximum duration of the search instance map operation; Default is 30 seconds.
 
Constructor Summary
ServiceClientTuning()
          Initializes a ServiceClientTuning with the default options: SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT, HEARTBEAT_DEFAULT_POLLING_PERIOD, HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT, and HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT.
ServiceClientTuning(int searchInstanceMapDurationInSecond, int heartBeatPollingPeriodInMilliSecond, int heartBeatActivationPeriodCount, int heartBeatDeadConnectionPeriodCount)
          Initializes a ServiceClientTuning with the specified options; Refer to the related methods detailled in the See Also section.
 
Method Summary
 int getConnectTimeout()
          Returns the max duration in millisecond to wait before to declared that a connecting operation has failed.
 int getHeartBeatActivationPeriodCount()
          Returns the number of polling period of the heartbeat service before to declare a connection not used.
 int getHeartBeatDeadConnectionPeriodCount()
          Returns the number of heartbeat service polling period before to declare a server instance is down.
 int getHeartBeatPollingPeriod()
          Returns the polling period of the heartbeat service.
 int getSearchInstanceMapTimeout()
          Returns the maximum duration of the searching instance map operation.
 boolean isDebugModeEnable()
          Returns if the debug mode is enable or not; This mode sets all the timeout to NO_TIMEOUT.
 void setConnectTimeout(int timeoutInMillisecond)
          Sets the maximum duration (in millisecond) to wait before to declared that a connecting operation has failed.
 void setHeartBeatActivationPeriodCount(int periodCount)
          Sets the number of polling periods (of the heartbeat service) that describes the inactivity duration of a connection after which the heartbeat will be activated on this connection.
 void setHeartBeatDeadConnectionPeriodCount(int periodCount)
          Sets the number of polling periods (of the heartbeat service) that describes the timeout after which an instance of the SAP CC system which has not replied to a heartbeat ping message, will be considered as down.
 void setHeartBeatPollingPeriod(int periodInMilliSecond)
          Sets the polling period of the heartbeat service.
 void setSearchInstanceMapTimeout(int durationInSecond)
          Sets the max duration of the searching instance map operation including the connection opening with the remote instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT

public static final int SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT
Constant describing the default maximum duration of the search instance map operation; Default is 30 seconds.

See Also:
Constant Field Values

HEARTBEAT_DEFAULT_POLLING_PERIOD

public static final int HEARTBEAT_DEFAULT_POLLING_PERIOD
Constant describing the default polling period of the heartbeat; Default is 2,000 milliseconds.

See Also:
Constant Field Values

HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT

public static final int HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT
Constant describing the default value of the heartbeat activation period count; Default is 1.

See Also:
Constant Field Values

HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT

public static final int HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT
Constant describing the default value of the heartbeat dead connection period count; Default is 2.

See Also:
Constant Field Values

CONNECT_TIMEOUT

public static final int CONNECT_TIMEOUT
Constant describing the default value for the connect timeout; Default is 10,000 ms.

See Also:
Constant Field Values
Constructor Detail

ServiceClientTuning

public ServiceClientTuning()
Initializes a ServiceClientTuning with the default options: SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT, HEARTBEAT_DEFAULT_POLLING_PERIOD, HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT, and HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT.

Refer to these constant values.


ServiceClientTuning

public ServiceClientTuning(int searchInstanceMapDurationInSecond,
                           int heartBeatPollingPeriodInMilliSecond,
                           int heartBeatActivationPeriodCount,
                           int heartBeatDeadConnectionPeriodCount)
Initializes a ServiceClientTuning with the specified options; Refer to the related methods detailled in the See Also section.

Note

If the system property transactive.debug.mode exists, the client is initialized in mode debug. The mode debug disables the Heartbeat service and sets the timeouts to NO_TIMEOUT. The specified timeouts are ignored.

Parameters:
searchInstanceMapDurationInSecond - The timeout of the search instance map
heartBeatPollingPeriodInMilliSecond - The heart beat polling period
heartBeatActivationPeriodCount - The heat beat activation polling period count
heartBeatDeadConnectionPeriodCount - The heart beat dead connection polling period count
See Also:
setSearchInstanceMapTimeout(int), setHeartBeatPollingPeriod(int), setHeartBeatActivationPeriodCount(int), setHeartBeatDeadConnectionPeriodCount(int)
Method Detail

setSearchInstanceMapTimeout

public void setSearchInstanceMapTimeout(int durationInSecond)
Sets the max duration of the searching instance map operation including the connection opening with the remote instance.

When the service client is connecting to the service server, it asks the boot server for the instance map. This operation can fail because the boot server is down or does not replied. This timeout is the max duration the client has to expect a reply from the server system. If this timeout is expired without replied, the client stops. Its default value is SEARCH_INSTANCE_MAP_DEFAULT_TIMEOUT.
If the server is down, the client may not wait this duration but stop immediatly. This timeout is useful when the server is running but cannot be reached by the client (ip interface down, firewall issues, etc...). In this case the client will take a long time before to stop. This timeout limit this duration. Of course, a too small timeout can prevent client for starting.

Parameters:
durationInSecond - A duration in second or Constants.NO_TIMEOUT if the timeout is not useful.
Throws:
java.lang.IllegalArgumentException - if durationInSecond is not equals Constants.NO_TIMEOUT and is negative.

getSearchInstanceMapTimeout

public int getSearchInstanceMapTimeout()
Returns the maximum duration of the searching instance map operation.

Returns:
The duration in second or Constants.NO_TIMEOUT if no timeout is needed
See Also:
setSearchInstanceMapTimeout(int)

setHeartBeatPollingPeriod

public void setHeartBeatPollingPeriod(int periodInMilliSecond)
Sets the polling period of the heartbeat service.

Useful only if the High Availability service is enabled (At least one rating instance backup is defined in the instance map), it is the duration between two heartbeat service activations. This service detects down or new restarted instances sending at each activation ping messages to the instances and makes the switches to or from the backups when useful.
Smaller is this value, faster is the detection of down or restarted instances and smaller is the service interruption, but more the network resources will be used. A too high value will make the service interruption longer but the network resources will be less used when all goes well.

Its default value is HEARTBEAT_DEFAULT_POLLING_PERIOD.

Parameters:
periodInMilliSecond - The period in millisecond
Throws:
java.lang.IllegalArgumentException - if periodInMilliSecond is smaller than 1

getHeartBeatPollingPeriod

public int getHeartBeatPollingPeriod()
Returns the polling period of the heartbeat service.

Returns:
A period in millisecond
See Also:
setHeartBeatPollingPeriod(int)

setHeartBeatActivationPeriodCount

public void setHeartBeatActivationPeriodCount(int periodCount)
Sets the number of polling periods (of the heartbeat service) that describes the inactivity duration of a connection after which the heartbeat will be activated on this connection.

The activation period is periodCount*getHeartBeatPollingPeriod(). If a connection has not been used during at least the activation period, the heartbeat will be activated and will start to detect if the connection is down or not (executing ping operation).
This parameter is useful to prevent to use of network resource when the client is in full charge.
Its default value is: HEARTBEAT_DEFAULT_ACTIVATION_PERIOD_COUNT.

Parameters:
periodCount - A positive number
Throws:
java.lang.IllegalArgumentException - if periodCount is negative
See Also:
setHeartBeatPollingPeriod(int)

getHeartBeatActivationPeriodCount

public int getHeartBeatActivationPeriodCount()
Returns the number of polling period of the heartbeat service before to declare a connection not used.

Returns:
A positive number
See Also:
setHeartBeatActivationPeriodCount(int)

setHeartBeatDeadConnectionPeriodCount

public void setHeartBeatDeadConnectionPeriodCount(int periodCount)
Sets the number of polling periods (of the heartbeat service) that describes the timeout after which an instance of the SAP CC system which has not replied to a heartbeat ping message, will be considered as down.

The dead connection period is periodCount*#getHeartBeatPollingPeriod(). If an instance has not replied to a heart beat ping message before this timeout has expired, it is considered as down. A too small value makes the heartbeat service detect down connection even if the instance is running. At the opposite a too high value will make service interruption with a really down instance very long.
Its default value is: HEARTBEAT_DEFAULT_DEAD_CONNECTION_PERIOD_COUNT.

Parameters:
periodCount - A positive number greather than 0
Throws:
java.lang.IllegalArgumentException - if periodCount is out of range
See Also:
setHeartBeatPollingPeriod(int)

getHeartBeatDeadConnectionPeriodCount

public int getHeartBeatDeadConnectionPeriodCount()
Returns the number of heartbeat service polling period before to declare a server instance is down.

Returns:
A positive number greater than 0
See Also:
setHeartBeatDeadConnectionPeriodCount(int)

setConnectTimeout

public void setConnectTimeout(int timeoutInMillisecond)
Sets the maximum duration (in millisecond) to wait before to declared that a connecting operation has failed.

This timeout is useful to detect the down instance faster.

Its default value is CONNECT_TIMEOUT.

Parameters:
timeoutInMillisecond - The timeout in millisecond positive, 0, or NO_TIMEOUT
Throws:
java.lang.IllegalArgumentException - if connectTimeoutInMilliSecond is out of range

getConnectTimeout

public int getConnectTimeout()
Returns the max duration in millisecond to wait before to declared that a connecting operation has failed.

Returns:
A positive value or NO_TIMEOUT

isDebugModeEnable

public boolean isDebugModeEnable()
Returns if the debug mode is enable or not; This mode sets all the timeout to NO_TIMEOUT.

Returns:
true if the debug mode is enabled, false otherwise

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)