Apama Documentation : Connecting Apama Applications to External Components : Working with IAF Plug-ins : Monitoring Adapter Status : Returning information from the getStatus method
Returning information from the getStatus method
The adapter's transport and codec getStatus methods periodically update status information. The transport and codec send this information to the IAFStatusManager. To take advantage of the IAFStatusManager for an adapter written in Java, the adapter author should implement the getStatus method so that it returns an ExtendedTransportStatus or ExtendedCodecStatus object. These objects include a Properties parameter, statusInfo, which contains custom information about the adapter.
For adapters written in C or C++, the adapter author should implement the getStatus function to include the statusDictionary in an AP_EventTransportStatus or AP_EventCodecStatus structure.
The IAFStatusManager then forwards the information to registered consumers of that transport or codec's status information in the form of a dictionary added to the AdapterUp event.
ExtendedTransportStatus
The ExtendedTransportStatus object is defined as follows:
public ExtendedTransportStatus(java.lang.String status,
long totalReceived,
long totalSent),
java.util.Properties statusInfo)
The object's parameters are:
*status - A string containing a transport-specific status message. Strings longer than 1024 characters will be truncated.
*totalReceived - The total number of downstream events received since the IAF was run.
*totalSent - The total number of upstream events sent since the IAF was run.
*statusInfo - Any additional status information about this transport. The standard statusInfo keys are:
*VERSION=transport_version_string
*CONFIG_VERSION=config_version_string
*CONNECTION=connectionGeneration (if the adapter manages only one connection)
or
*CONNECTION_connectionId=connectionGeneration (if the adapter manages multiple connections)
For more information on specifying the CONNECTION or CONNECTION_connectionId key, see Asynchronously notifying IAFStatusManager of connection changes.
ExtendedCodecStatus
The ExtendedCodecStatus object is defined as follows:
public CodecStatus(java.lang.String status,
long totalDecoded,
long totalEncoded),
java.util.Properties statusInfo
The object's parameters are:
*status - A string containing a codec-specific status message. Strings longer than 1024 characters will be truncated.
*totalDecoded - The number of events decoded
*totalEncoded - The number of events encoded
*statusInfo - Any additional status information bout this codec. Standard statusInfo keys are:
*VERSION=codec_version_string
*CONFIG_VERSION=config_version_string
*CONNECTION=connectionGeneration (if the adapter manages only one connection),
or
*CONNECTION_connectionId=connectionGeneration (if the adapter manages multiple connections
AP_EventTransportStatus
The AP_EventTransportStatus object is defined as:
typedef struct {
   AP_char8* status;
   AP_uint64 totalReceived;
   AP_uint64 totalSent;
   AP_NormalisedEvent* statusDictionary;
} AP_EventTransportStatus;
The object's parameters are:
*status - A free-form text string containing a transport-specific status message. Strings longer than 1024 characters will be truncated.
*totalReceived - The total number of downstream events received since the IAF was run.
*totalSent - The total number of upstream events sent since the IAF was run.
*statusDictionary - Any additional status information about this transport. The standard statusDictionary keys are:
*VERSION=transport_version_string
*CONFIG_VERSION=config_version_string
*CONNECTION=connectionGeneration (if the adapter manages only one connection)
or
*CONNECTION_connectionId=connectionGeneration (if the adapter manages multiple connections)
AP_EventCodecStatus
The AP_EventCodecStatus object s defined as:
typedef struct {
   AP_char8* status;
   AP_uint64 totalDecoded;
   AP_uint64 totalEncoded;
   AP_NormalisedEvent* statusDictionary;
} AP_EventCodecStatus;
The object's parameters are:
*status - A free-form text string containing a codec-specific status message. Strings longer than 1024 characters will be truncated.
*totalDecoded - The number of events decoded.
*totalEncoded - The number of events encoded.
*statusDictionary - Any additional status information about this codec. Standard statusDictionary keys are:
*VERSION=codec_version_string
*CONFIG_VERSION=config_version_string
*CONNECTION=connectionGeneration (if the adapter manages only one connection),
or
*CONNECTION_connectionId=connectionGeneration (if the adapter manages multiple connections)
Example
In the following example, the custom status information for VERSION and CONNECTION is included in the information returned by the getStatus method:
public static final String TRANSPORT_VERSION="1";
protected long connGeneration;
...
public TransportStatus getStatus()
   {
     Properties properties=new Properties();
     properties.setProperty("VERSION", TRANSPORT_VERSION);
    if(market!=null)
       {
        properties.setProperty("CONNECTION",
             String.valueOf(connGeneration));
       }
     return new ExtendedTransportStatus("OK", numReceived, numSent,
properties);
   }
For more information on specifying the CONNECTION property, see Asynchronously notifying IAFStatusManager of connection changes.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback