|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsystemic.sif.sifcommon.BaseInfo
systemic.sif.sifcommon.subscriber.BaseSubscriber
public abstract class BaseSubscriber
All subscribers should extend this class. It ensures that resources are dealt with correctly.
Constructor Summary | |
---|---|
BaseSubscriber(java.lang.String subscriberID)
This class is a basic initialiser of a subscriber. |
Method Summary | |
---|---|
void |
debugOnEvent(openadk.library.Event event,
openadk.library.Zone zone,
openadk.library.MessageInfo messageinfo)
Used for debugging purpose. |
void |
debugOnQueryResults(openadk.library.DataObjectInputStream dataobjectinputstream,
openadk.library.infra.SIF_Error sif_error,
openadk.library.Zone zone,
openadk.library.MessageInfo messageinfo)
Used for debugging purpose. |
abstract void |
finalise()
This method should release all resources associated with the given subscriber. |
openadk.library.QueryResultsOptions |
getQueryResultsOptions()
|
openadk.library.SubscriptionOptions |
getSubscriptionOptions()
|
void |
onEvent(openadk.library.Event event,
openadk.library.Zone zone,
openadk.library.MessageInfo msgInfo)
Default implementation of the SIFWorks ADK onEvent() method. |
void |
onQueryPending(openadk.library.MessageInfo msgInfo,
openadk.library.Zone zone)
|
void |
onQueryResults(openadk.library.DataObjectInputStream dataobjectinputstream,
openadk.library.infra.SIF_Error sifError,
openadk.library.Zone zone,
openadk.library.MessageInfo msgInfo)
Default implementation of the SIFWorks ADK onQueryResults() method. |
abstract void |
processEvent(SIFEvent sifEvent,
openadk.library.Zone zone,
MappingInfo mappingInfo,
java.lang.String consumerID)
This method will process the given event. |
abstract void |
processResponse(openadk.library.SIFDataObject sifObject,
openadk.library.Zone zone,
MappingInfo mappingInfo,
java.lang.String consumerID)
This method will process the given SIF Object. |
void |
provision(openadk.library.Zone zone)
Allows this data handler class to provision itself with the zone. |
void |
reportSIFError(openadk.library.infra.SIF_Error sifError,
openadk.library.Zone zone)
This method deals with an error that has been received from the zone in relation to a SIF response. |
void |
run()
This method is all that is needed to run the subscriber in its own thread. |
void |
setQueryResultsOptions(openadk.library.QueryResultsOptions queryResultsOptions)
|
void |
setSubscriptionOptions(openadk.library.SubscriptionOptions subscriptionOptions)
|
void |
shutdownSubscriber()
This method shuts down this subscriber gracefully. |
void |
startConsumers()
This method starts up all the consumers for this subscriber. |
Methods inherited from class systemic.sif.sifcommon.BaseInfo |
---|
getAgentConfig, getAgentID, getAgentProperties, getAgentProperty, getApplicationID, getDtd, getFrameworkProperties, getId, getMappings, getZoneByID, getZones, isValidZone, setAgentConfig, setAgentID, setAgentProperties, setApplicationID, setDtd, setFrameworkProperties, setId, setMappings, setZones |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseSubscriber(java.lang.String subscriberID)
subscriberID
- The unique ID of this subscriber. Ideally this is the class name but this is not
necessary. This ID is used throughout the SIFCommon Framework classes to access
properties in the SIFAgent.properties file. This ID must match the reference
in this property file for the given subscriber.Method Detail |
---|
public abstract void processEvent(SIFEvent sifEvent, openadk.library.Zone zone, MappingInfo mappingInfo, java.lang.String consumerID) throws openadk.library.ADKException
This method is being called as part of the default implementation of the onEvent() method of the SIFworks ADK.
sifEvent
- The SIF Event to be processed.zone
- The Zone that has received the event.mappingInfo
- The mapping info that can be used if mapping is available. Note that property
mappingCtx of this parameter can be null if there is no mapping available
for the given subscriber and its SIF Object it deals with (ie. No mapping for
StudentPersonal).consumerID
- The ID of the consumer that processes this event. Because the subscriber uses
a multi-threaded consumer model it can be useful to know which particular consumer
is asked to process this event.
openadk.library.ADKException
- Any issues that arise with the processing of the event that need to be captured
and logged.public abstract void processResponse(openadk.library.SIFDataObject sifObject, openadk.library.Zone zone, MappingInfo mappingInfo, java.lang.String consumerID) throws openadk.library.ADKException
This method is being called as part of the default implementation of the onRequest() method of the SIFworks ADK.
sifObject
- The SIF Object to be processed.zone
- The Zone that has received the SIF Object.mappingInfo
- The mapping info that can be used if mapping is available. Note that property
mappingCtx of this parameter can be null if there is no mapping available
for the given subscriber and its SIF Object it deals with (ie. No mapping for
StudentPersonal).consumerID
- The ID of the consumer that processes this SIF Message. Because the subscriber uses
a multi-threaded consumer model it can be useful to know which particular consumer
is asked to process this SIF Message.
openadk.library.ADKException
- Any issues that arise with the processing of the SIF Object that need to be
captured and logged.public abstract void finalise()
public final void run()
run
in interface java.lang.Runnable
public final void startConsumers() throws java.util.concurrent.ExecutionException
This class requires the 'frameworkProperties' of the BaseInfo to be set, otherwise an ExecutionException will be thrown.
java.util.concurrent.ExecutionException
- Issue with starting the consumers of missing properties in the BaseInfo
class.public void provision(openadk.library.Zone zone) throws openadk.library.ADKException
Provisioning involves notifying the zone of any objects this class subscribes, or provides data for, or whether this class should be notified of SIF_Responses for a specific data type.
zone
- The representation of a SIF Zone inside the ADK
openadk.library.ADKException
public void onQueryPending(openadk.library.MessageInfo msgInfo, openadk.library.Zone zone) throws openadk.library.ADKException
onQueryPending
in interface openadk.library.QueryResults
openadk.library.ADKException
public final void onEvent(openadk.library.Event event, openadk.library.Zone zone, openadk.library.MessageInfo msgInfo) throws openadk.library.ADKException
onEvent
in interface openadk.library.Subscriber
openadk.library.ADKException
public final void onQueryResults(openadk.library.DataObjectInputStream dataobjectinputstream, openadk.library.infra.SIF_Error sifError, openadk.library.Zone zone, openadk.library.MessageInfo msgInfo) throws openadk.library.ADKException
onQueryResults
in interface openadk.library.QueryResults
openadk.library.ADKException
public void reportSIFError(openadk.library.infra.SIF_Error sifError, openadk.library.Zone zone)
sifError
- The SIF Error that has been received. This value is not null.zone
- The zone for which the error has been received.public final void shutdownSubscriber()
public openadk.library.SubscriptionOptions getSubscriptionOptions()
public void setSubscriptionOptions(openadk.library.SubscriptionOptions subscriptionOptions)
public openadk.library.QueryResultsOptions getQueryResultsOptions()
public void setQueryResultsOptions(openadk.library.QueryResultsOptions queryResultsOptions)
public void debugOnQueryResults(openadk.library.DataObjectInputStream dataobjectinputstream, openadk.library.infra.SIF_Error sif_error, openadk.library.Zone zone, openadk.library.MessageInfo messageinfo) throws openadk.library.ADKException
openadk.library.ADKException
public void debugOnEvent(openadk.library.Event event, openadk.library.Zone zone, openadk.library.MessageInfo messageinfo) throws openadk.library.ADKException
openadk.library.ADKException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |