Class ServiceClientTuning

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

public class ServiceClientTuning extends 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 Details

    • 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:
    • 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:
    • 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:
    • 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:
    • CONNECT_TIMEOUT

      public static final int CONNECT_TIMEOUT
      Constant describing the default value for the connect timeout; Default is 10,000 ms.
      See Also:
  • Constructor Details

  • Method Details

    • 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:
      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:
    • 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:
      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:
    • 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:
      IllegalArgumentException - if periodCount is negative
      See Also:
    • 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:
    • 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:
      IllegalArgumentException - if periodCount is out of range
      See Also:
    • 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:
    • 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.

      • A too small value prevents the connection to be established.
      • A too high value make the service interruption longer.

      Its default value is CONNECT_TIMEOUT.

      Parameters:
      timeoutInMillisecond - The timeout in millisecond positive, 0, or NO_TIMEOUT
      Throws:
      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