org.instrumentmiddleware.cima.plugin
Interface IPlugin

All Known Subinterfaces:
ICIMAOperationExtension, ICIMAPlugin, ICommandEnable, IParcelProducer, IPluginOperationExtension, IProducer
All Known Implementing Classes:
AbstractMultiPollerParcelProducer, AbstractPlugin, AbstractProducer, AbstractSinglePollerParcelProducer, ExampleOperationPlugin, OnDataSinglePollerParcelProducer, RegularIntervalMultiPollerParcelProducer, RegularIntervalSinglePollerParcelProducer

public interface IPlugin

A plugin within CIMA is a very generic concept and thus this interface only contains generic methods. Each plugin should have a unique identifier within a CIMA instance and should respond to requests to start and stop. In addition, each plugin should be able to supply some information about it to aid in discovery and utilisation of the plugin.

Author:
andrew

Method Summary
 org.instrumentmiddleware.cima.parcel.SubscriptionResponseType doSubscribe(SubscribeInfo info)
           
 java.lang.String getId()
          Get the plugins id.
 org.w3c.dom.Node getInformation()
          Provide access to this plugins information.
 int getSequenceNumber()
          Get the next sequence number for parcels created by this plugin.
 org.instrumentmiddleware.cima.parcel.ResponseType processParcel(org.instrumentmiddleware.cima.parcel.BodyType body, java.util.Calendar creationTime, ISession session, org.instrumentmiddleware.cima.parcel.ResponseType response)
          Process a parcel.
 void setStartOnLoad(boolean startOnLoad)
          This method is used to specify if this plugin will be started automatically after being loaded.
 void start()
          Start this plugin.
 boolean startOnLoad()
          Returns true if this plugin has been configured to start automatically after being loaded
 void stop()
          Stop this plugin.
 

Method Detail

getId

java.lang.String getId()
Get the plugins id. Each plugin has a unique identifier with a CIMA instance, and it is obtained via this method.

Returns:
the id

start

void start()
           throws PluginException
Start this plugin. This allows a plugin to perform some initialisation and is called when CIMA expects some interaction with this plugin

Throws:
PluginException

stop

void stop()
          throws PluginException
Stop this plugin. This allows a plugin to perform some cleanup and is called when CIMA expects no further interaction with this plugin

Throws:
PluginException

getInformation

org.w3c.dom.Node getInformation()
Provide access to this plugins information. This is currently represented as a DOM node to allow any XML to be returned to describe the plugin. In practice plugins may choose some well known vocabulary to describe themselves, such as SensorML.

Returns:
Some XML containing the information for this plugin

getSequenceNumber

int getSequenceNumber()
Get the next sequence number for parcels created by this plugin. Each parcel created by this plugin should have a sequence number to distinguish it from other communications with this plugin. Each sequence number should be unique, so the standard implementation is an incrementing integer. TODO: this description is lame and probably indicates that this method doesn't belong here.

Returns:
the next sequence number.

processParcel

org.instrumentmiddleware.cima.parcel.ResponseType processParcel(org.instrumentmiddleware.cima.parcel.BodyType body,
                                                                java.util.Calendar creationTime,
                                                                ISession session,
                                                                org.instrumentmiddleware.cima.parcel.ResponseType response)
                                                                throws PluginException
Process a parcel. This method is very generic and allows CIMA to let the plugin handle any parcel that is relevant for the plugin. The parcel returned is the response to the request and may be validated before returning to the requester. Under normal circumstances the response returned will a reference to the third argument UNLESS a type change has been performed on the response (see http://xmlbeans.apache.org/docs/2.2.0/reference/org/apache/xmlbeans/XmlObject.html#changeType(org.apache.xmlbeans.SchemaType) for more information) in which case a reference to the new type should be returned.

Parameters:
request - the request parcel
Throws:
PluginException - if there is a problem while processing the parcel

startOnLoad

boolean startOnLoad()
Returns true if this plugin has been configured to start automatically after being loaded

Returns:
true if this plugin has been configured to start automatically after being loaded

setStartOnLoad

void setStartOnLoad(boolean startOnLoad)
This method is used to specify if this plugin will be started automatically after being loaded.

Parameters:
startOnLoad - If true, this plugin will start automatically after being loaded

doSubscribe

org.instrumentmiddleware.cima.parcel.SubscriptionResponseType doSubscribe(SubscribeInfo info)


Copyright © 2008. All Rights Reserved.