Platform SDK Java 8.5 API Reference

com.genesyslab.platform.reporting.protocol.statserver.requests
Class RequestCloseStatistic

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.DataObject
      extended by com.genesyslab.platform.commons.protocol.Message
          extended by com.genesyslab.platform.reporting.protocol.statserver.requests.RequestCloseStatistic
All Implemented Interfaces:
ProtocolDescriptionSupport

public abstract class RequestCloseStatistic
extends Message

Requests that Stat Server stop sending information about a particular statistic.

Required parameters:

Name Description
StatisticId ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx that was used to open the statistics.

Related Events:
Name Description
EventStatisticClosed Indicates that the referenced statistic has been closed.
EventError Indicates that the request encountered an error.

Note1
There was a specific Stat Server version 8.1.200.24 with changed behavior on this request. It responds to the statistic close request using event with ReferenceId value equal to correspondent open request. As a result, "Message resp = protocol.request(requestCloseStat);" fails to match the server response, and returns null after the protocol timeout.
So, if it is supposed by user application to support mentioned Stat Server version, and there is a need to check server responses on statistics close requests, it may be done with asynchronous protocol operations using MessageHandler.

Example:
This request requires that you specify the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx that was used to open the statistic, as shown here:

Protocol initialization for asynchronous operations handling:

 StatServerProtocol statProtocol = new StatServerProtocol(statEndpoint);
 ...
 statProtocol.setMessageHandler(new StatMessageHandler());
 statProtocol.open();
 ...
 protected class StatMessageHandler implements MessageHandler {
     public void onMessage(final Message message) {
         if (message.messageId() == EventInfo.ID) {
             EventInfo eventInfo = (EventInfo) message;
             // TODO handle async statistic data
         } else if (message.messageId() == EventStatisticClosed.ID) {
             EventStatisticClosed evStatClosed = (EventStatisticClosed) message;
             // TODO handle statistic close event
             Integer statId = evStatClosed.getIntValue();
             if (statId == null || statId.intValue() == 0) {
                 statId = evStatClosed.getReferenceId();
             }
             // 'statId' reflects 'referenceIdFromRequestOpenStatistic'
             // Note: it's also possible to match the close event using 'Tag' attribute passed to the stat open request
         } else {
             // TODO handle other statserver events...
         }
     }
 }
 
Doing asynchronous statistic close request:

 RequestCloseStatistic req = RequestCloseStatistic.create();
 req.setStatisticId(referenceIdFromRequestOpenStatistic);
 statProtocol.send(req); // result of this operation will be delivered to the StatMessageHandler
 
Note2
MessageHandler component is not compatible with MessageReceiver.
It means that statProtocol.receive(); will be no longer working, and all incoming protocol events (including EventInfo statistics notifications) will go to the StatMessageHandler.


Field Summary
static int ID
           
static java.lang.String NAME
           
 
Method Summary
static RequestCloseStatistic create()
          Creates instance of RequestCloseStatistic with no parameters set.
static RequestCloseStatistic create(java.lang.Integer statisticId)
          Creates instance of RequestCloseStatistic with all parameters set.
abstract  java.lang.Integer getReferenceId()
          A unique integer that is specified for identification of requested statistics.
abstract  java.lang.Integer getStatisticId()
          Refers to the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx associated with this request: Stat Server needs this information so that it can take action on the appropriate set of statistical information.
abstract  void setReferenceId(int referenceId)
          A unique integer that is specified for identification of requested statistics.
abstract  void setReferenceId(java.lang.Integer referenceId)
          A unique integer that is specified for identification of requested statistics.
abstract  void setStatisticId(int statisticId)
          Refers to the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx associated with this request: Stat Server needs this information so that it can take action on the appropriate set of statistical information.
abstract  void setStatisticId(java.lang.Integer statisticId)
          Refers to the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx associated with this request: Stat Server needs this information so that it can take action on the appropriate set of statistical information.
 
Methods inherited from class com.genesyslab.platform.commons.protocol.Message
cloneMessage, getEndpoint, getMessageAttribute, getProtocolDescription, getProtocolId, messageId, messageName, setProtocolDescription
 
Methods inherited from class com.genesyslab.platform.commons.protocol.DataObject
equals, hashCode, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final int ID
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Method Detail

create

public static RequestCloseStatistic create()
Creates instance of RequestCloseStatistic with no parameters set.

Returns:
instance of RequestCloseStatistic

create

public static RequestCloseStatistic create(java.lang.Integer statisticId)
Creates instance of RequestCloseStatistic with all parameters set.

Parameters:
statisticId - StatisticId
Returns:
instance of RequestCloseStatistic

getReferenceId

public abstract java.lang.Integer getReferenceId()
A unique integer that is specified for identification of requested statistics. This property can be assigned automatically just before sending a message. If property has already been assigned, it will not be modified automatically. If you specify this property on your own, you should guarantee its uniqueness.


setReferenceId

public abstract void setReferenceId(java.lang.Integer referenceId)
A unique integer that is specified for identification of requested statistics. This property can be assigned automatically just before sending a message. If property has already been assigned, it will not be modified automatically. If you specify this property on your own, you should guarantee its uniqueness.


setReferenceId

public abstract void setReferenceId(int referenceId)
A unique integer that is specified for identification of requested statistics. This property can be assigned automatically just before sending a message. If property has already been assigned, it will not be modified automatically. If you specify this property on your own, you should guarantee its uniqueness.


getStatisticId

public abstract java.lang.Integer getStatisticId()
Refers to the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx associated with this request: Stat Server needs this information so that it can take action on the appropriate set of statistical information.


setStatisticId

public abstract void setStatisticId(java.lang.Integer statisticId)
Refers to the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx associated with this request: Stat Server needs this information so that it can take action on the appropriate set of statistical information.


setStatisticId

public abstract void setStatisticId(int statisticId)
Refers to the ReferenceId of the RequestOpenStatistic or RequestOpenStatisticEx associated with this request: Stat Server needs this information so that it can take action on the appropriate set of statistical information.


Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.