com.highdeal.cnd.message
Class AsyncStatefulServiceClientCtrl

java.lang.Object
  extended by com.highdeal.cnd.message.AsyncStatefulServiceClientCtrl
All Implemented Interfaces:
ClientOpEventListener

public class AsyncStatefulServiceClientCtrl
extends java.lang.Object
implements ClientOpEventListener

This class represents a client operation event listener able to supervise the activity of the instances of the SAP CC Core Server system by limiting the number of operations in the server instances.
It is possible to enable the average latency controller. But the expected latency cannot be lower than the system's minimum. This can decrease the charging operation throughput.

Performance Management

You can fine tune the behavior of your client application for processing real-time charging services. The following advanced options are available:

Recommendation

During the implementation project phase:

Refer to the SAP CC System Parameter Reference for more information about this system parameter.

Implementation in Your Client Application

Code Snippet

Here is an example of use:

      AsyncStatefulServiceClient client = new AsyncStatefulServiceClient();
      client.setClientOpEventListener(ClientOpEventTopic.DEFAULT, new AsyncStatefulServiceClientCtrl());
 

Notes on SAP CC Implementation

This fine-tuning depends on the fine-tuning of the connected SAP CC system. This system may be customized during the implementation project phase. Consider the values of the STATEFUL_SERVICE_QUEUE_SIZE system parameter. Consult the SAP CC System Parameter Reference for more information.


Field Summary
static int MIN_QUEUE_SIZE_TO_NOTIFY_VALUE
           
static int MIN_QUEUE_SIZE_TO_WAIT_VALUE
           
static int QUEUE_SIZE_TO_NOTIFY_DEFAULT_VALUE
           
static int QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE
           
 
Constructor Summary
AsyncStatefulServiceClientCtrl()
          This is an equivalent of AsyncStatefulServiceClientCtrl(AsyncStatefulServiceClientCtrl.QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE, AsyncStatefulServiceClientCtrl.MIN_QUEUE_SIZE_TO_NOTIFY_VALUE)
AsyncStatefulServiceClientCtrl(int queueSizeToWait, int queueSizeToNotify)
          The queueSizeToWait is the maximum number of waiting requests to be executed by the servers.
 
Method Summary
 void onLookupException(ClientOpEventInformation clientOpInfo)
          Called if an exception is raised during the guiding lookup before giving a response to the client.
 void onLookupResult(ClientOpEventInformation clientOpInfo)
          Called when the guiding lookup result is received.
 ClientOpEventInformation onLookupStart(ClientOpEventTopic topic)
          Called before the guiding lookup only if the the guiding lookup is the first action of the client operation.
 void onOpException(ClientOpEventInformation clientOpInfo)
          Called if an exception is raised during the operation execution before giving a response to the client.
 void onOpResult(ClientOpEventInformation clientOpInfo)
          Called when the operation result is received.
 ClientOpEventInformation onOpStart(ClientOpEventTopic topic)
          Called when an operation start only if the first operation is not a guiding lookup.
 void onOpStartAnotherOperation(ClientOpEventInformation clientOpInfo)
          Called when a failed operation implies to call another operation.
 void setClientQueueListenerSize(int maxQueueSizeToWait, int minQueueSizeToWait, int queueSizeToNotify, long spotLatency)
          The queueSizeToWait is the maximum number of waiting requests to be executed by the servers; Additional requests make the client waiting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE

public static final int QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE
See Also:
Constant Field Values

QUEUE_SIZE_TO_NOTIFY_DEFAULT_VALUE

public static final int QUEUE_SIZE_TO_NOTIFY_DEFAULT_VALUE
See Also:
Constant Field Values

MIN_QUEUE_SIZE_TO_WAIT_VALUE

public static final int MIN_QUEUE_SIZE_TO_WAIT_VALUE
See Also:
Constant Field Values

MIN_QUEUE_SIZE_TO_NOTIFY_VALUE

public static final int MIN_QUEUE_SIZE_TO_NOTIFY_VALUE
See Also:
Constant Field Values
Constructor Detail

AsyncStatefulServiceClientCtrl

public AsyncStatefulServiceClientCtrl()
This is an equivalent of AsyncStatefulServiceClientCtrl(AsyncStatefulServiceClientCtrl.QUEUE_SIZE_TO_WAIT_DEFAULT_VALUE, AsyncStatefulServiceClientCtrl.MIN_QUEUE_SIZE_TO_NOTIFY_VALUE)


AsyncStatefulServiceClientCtrl

public AsyncStatefulServiceClientCtrl(int queueSizeToWait,
                                      int queueSizeToNotify)
The queueSizeToWait is the maximum number of waiting requests to be executed by the servers. Additional requests make the client waiting. When the number of waiting requests get lower or equal to queueSizeToNotify and at least one client waits, all the clients are woke up.

Parameters:
queueSizeToWait - The queueSizeToWait value, the minimal value is MIN_QUEUE_SIZE_TO_WAIT_VALUE.
queueSizeToNotify - The queueSizeToNotify value, the minimal value is MIN_QUEUE_SIZE_TO_NOTIFY_VALUE and the maximal value is the value of queueListenerSizeToWait parameter minus one.
Method Detail

setClientQueueListenerSize

public void setClientQueueListenerSize(int maxQueueSizeToWait,
                                       int minQueueSizeToWait,
                                       int queueSizeToNotify,
                                       long spotLatency)
The queueSizeToWait is the maximum number of waiting requests to be executed by the servers; Additional requests make the client waiting. The minQueueSizeToWait, maxQueueSizeToWait is couple of minimal, maximum values used to adapt queueSizeToWait according to expected latency. When the number of waiting requests get lower or equal to queueSizeToNotify and at least one client waits, all the clients are woke up.

Parameters:
maxQueueSizeToWait - The maxQueueSizeToWait value, the minimal value is MIN_QUEUE_SIZE_TO_WAIT_VALUE.
minQueueSizeToWait - The minQueueSizeToWait value, the minimal value is MIN_QUEUE_SIZE_TO_WAIT_VALUE.
queueSizeToNotify - The queueListenerSizeToNotify value, the minimal value is MIN_QUEUE_SIZE_TO_NOTIFY_VALUE and the maximal value is the value of queueListenerSizeToWait parameter minus one.
spotLatency - The expected average latency. The minimal value is 1 to enable the average latency controller.

onLookupResult

public void onLookupResult(ClientOpEventInformation clientOpInfo)
Description copied from interface: ClientOpEventListener
Called when the guiding lookup result is received.

Specified by:
onLookupResult in interface ClientOpEventListener
Parameters:
clientOpInfo - The ClientOpEventInformation that generated the event.

onLookupStart

public ClientOpEventInformation onLookupStart(ClientOpEventTopic topic)
Description copied from interface: ClientOpEventListener
Called before the guiding lookup only if the the guiding lookup is the first action of the client operation.

Specified by:
onLookupStart in interface ClientOpEventListener
Parameters:
topic - the ClientOpEventTopic of the event.

onOpStart

public ClientOpEventInformation onOpStart(ClientOpEventTopic topic)
Description copied from interface: ClientOpEventListener
Called when an operation start only if the first operation is not a guiding lookup.

Specified by:
onOpStart in interface ClientOpEventListener
Parameters:
topic - the ClientOpEventTopic of the event.

onLookupException

public void onLookupException(ClientOpEventInformation clientOpInfo)
Description copied from interface: ClientOpEventListener
Called if an exception is raised during the guiding lookup before giving a response to the client.

Specified by:
onLookupException in interface ClientOpEventListener
Parameters:
clientOpInfo - The ClientOpEventInformation that generated the event.

onOpResult

public void onOpResult(ClientOpEventInformation clientOpInfo)
Description copied from interface: ClientOpEventListener
Called when the operation result is received.

Specified by:
onOpResult in interface ClientOpEventListener
Parameters:
clientOpInfo - The ClientOpEventInformation that generated the event.

onOpException

public void onOpException(ClientOpEventInformation clientOpInfo)
Description copied from interface: ClientOpEventListener
Called if an exception is raised during the operation execution before giving a response to the client.

Specified by:
onOpException in interface ClientOpEventListener
Parameters:
clientOpInfo - The ClientOpEventInformation that generated the event.

onOpStartAnotherOperation

public void onOpStartAnotherOperation(ClientOpEventInformation clientOpInfo)
Description copied from interface: ClientOpEventListener
Called when a failed operation implies to call another operation.

Specified by:
onOpStartAnotherOperation in interface ClientOpEventListener
Parameters:
clientOpInfo - The ClientOpEventInformation that generated the event.

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