org.globus.mds.trigger.impl
Class TriggerResource

java.lang.Object
  extended byorg.globus.mds.aggregator.impl.AggregatorServiceGroupResource
      extended byorg.globus.mds.trigger.impl.TriggerResource
All Implemented Interfaces:
AggregatorSink, org.globus.wsrf.RemoveCallback, org.globus.wsrf.Resource, org.globus.wsrf.ResourceProperties, ServiceGroupRegistrationResource, ServiceGroupResource, org.globus.wsrf.TopicListAccessor

public class TriggerResource
extends AggregatorServiceGroupResource
implements AggregatorSink, org.globus.wsrf.TopicListAccessor

Implementation of a Trigger ServiceGroup resource. Each resource is also an aggregator sink, in order to match trigger rules against received data.


Field Summary
static QName FIRE_COUNT_RP
           
static QName RP_SET
           
protected  Calendar terminationTime
           
static String TRIGGER_NS
           
 
Fields inherited from class org.globus.mds.aggregator.impl.AggregatorServiceGroupResource
DEFAULT_SWEEP_PERIOD, REGISTRATION_COUNT_RP
 
Constructor Summary
TriggerResource()
           
 
Method Summary
 void deliver(AnyContentType messageObj, AggregatorServiceGroupEntryResource entry)
          Takes delivery of a message from an AggregatorSource and applies the appropriate rules to it.
 Document evaluateXPath(Document inputDoc, String xPathExpression, String[] namespaces)
           
 Calendar getCurrentTime()
           
 org.globus.wsrf.ResourceKey getResourceKey()
           
 AggregatorSource getSource()
          Gets the AggregatorSource connected to this sink
 Calendar getTerminationTime()
           
 org.globus.wsrf.TopicList getTopicList()
           
 TriggerConfiguration getTriggerConfiguration()
           
 void initialize(Object parameters)
          Called to initialize any necessary state.
 void setResourceKey(org.globus.wsrf.ResourceKey k)
          Used to inform the resource of its key.
 void setSource(AggregatorSource source)
          Sets the AggregatorSource connected to this sink
 void setTerminationTime(Calendar time)
           
 void terminate()
          Called to free resources used by the sink.
 
Methods inherited from class org.globus.mds.aggregator.impl.AggregatorServiceGroupResource
addAggregatorSource, decrementCurrent, getConfiguration, getCurrentRegCount, getKey, getLifetimeRegTotal, getResourcePropertySet, incrementCurrent, incrementTotal, init, iterateEntryKeys, iterateEntryValues, loadCompatibleSources, notifyChange, remove, removeAllEntryResources, removeEntryResource, serviceGroupAdd, setVersion, unloadSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIGGER_NS

public static final String TRIGGER_NS
See Also:
Constant Field Values

RP_SET

public static final QName RP_SET

FIRE_COUNT_RP

public static final QName FIRE_COUNT_RP

terminationTime

protected Calendar terminationTime
Constructor Detail

TriggerResource

public TriggerResource()
Method Detail

getTriggerConfiguration

public TriggerConfiguration getTriggerConfiguration()

setResourceKey

public void setResourceKey(org.globus.wsrf.ResourceKey k)
                    throws Exception
Used to inform the resource of its key.

Throws:
Exception

getResourceKey

public org.globus.wsrf.ResourceKey getResourceKey()

setTerminationTime

public void setTerminationTime(Calendar time)

getTerminationTime

public Calendar getTerminationTime()

getCurrentTime

public Calendar getCurrentTime()

getTopicList

public org.globus.wsrf.TopicList getTopicList()
Specified by:
getTopicList in interface org.globus.wsrf.TopicListAccessor

deliver

public void deliver(AnyContentType messageObj,
                    AggregatorServiceGroupEntryResource entry)
Takes delivery of a message from an AggregatorSource and applies the appropriate rules to it.

Specified by:
deliver in interface AggregatorSink
Parameters:
messageObj - the message against which any registered triggerRules will be applied against
entry - this AggregatorServiceGroupEntryResource should contain appropriate trigger service rules in the AggregatorConfig block of the ServiceGroupEntry Content member. TODO: should there be any queuing/locking to stop multiple triggers (either for same rule or for all rules) from firing simultaneously? TODO: add a thread pool for executing trigger actions, break up the monolith

evaluateXPath

public Document evaluateXPath(Document inputDoc,
                              String xPathExpression,
                              String[] namespaces)
                       throws Exception
Throws:
Exception

initialize

public void initialize(Object parameters)
Description copied from interface: AggregatorSink
Called to initialize any necessary state. This method should throw an exception if the host AggregatorSource is not set. The underlying implementation may also throw an exception during initialization if it is not compatible with the host AggregationSource. The implementation may use the optional parameters Object to read implementation specific data or can just ignore processing it altogether. TODO: add custom exceptions here like SourceNotSet and SourceTypeNotSupported

Specified by:
initialize in interface AggregatorSink

terminate

public void terminate()
Description copied from interface: AggregatorSink
Called to free resources used by the sink.

Specified by:
terminate in interface AggregatorSink

setSource

public void setSource(AggregatorSource source)
Description copied from interface: AggregatorSink
Sets the AggregatorSource connected to this sink

Specified by:
setSource in interface AggregatorSink

getSource

public AggregatorSource getSource()
Description copied from interface: AggregatorSink
Gets the AggregatorSource connected to this sink

Specified by:
getSource in interface AggregatorSink


Copyright © 1999-2006 University of Chicago. All rights reserved.