org.globus.mds.aggregator.impl
Class SubscriptionAggregatorSource

java.lang.Object
  extended by org.globus.mds.aggregator.impl.SubscriptionAggregatorSource
All Implemented Interfaces:
AggregatorSource

public class SubscriptionAggregatorSource
extends java.lang.Object
implements AggregatorSource

An AggregatorSource which generates data using asyncrhonous subscription-based messaging.


Nested Class Summary
protected  class SubscriptionAggregatorSource.NotificationCallback
           
 
Field Summary
private  NotificationConsumerManager consumer
           
private  boolean initialized
           
(package private)  WSResourceLifetimeServiceAddressingLocator lifetimeLocator
           
private  org.globus.axis.message.addressing.EndpointReferenceType localEPR
           
(package private)  WSBaseNotificationServiceAddressingLocator locator
           
private static org.apache.commons.logging.Log logger
           
private  java.lang.String resDescFilename
           
private  java.util.Hashtable sessions
           
private  AggregatorSink sink
           
private  java.lang.Object sinkParameters
           
 
Constructor Summary
SubscriptionAggregatorSource(AggregatorSink sink)
           
SubscriptionAggregatorSource(AggregatorSink sink, java.lang.Object sinkParameters)
          Creates a new instance of SubscriptionAggregatorSource
 
Method Summary
 java.lang.String addAggregation(java.lang.Object parameters, AggregatorServiceGroupEntryResource entry)
          Establishes an implementation-specific data aggregation session.
 AggregatorSink getAggregatorSink()
          Gets the AggregatorSink instance where data from the underlying AggregatorSource will be routed, or NULL if not set.
 AggregatorServiceGroupEntryResource getSessionContext(java.lang.String sessionKey)
          Retrieve AggregatorServiceGroupEntryResource entry context.
 java.lang.String getSessionKey(AggregatorServiceGroupEntryResource entry)
          Get a sessionKey from a given entry context.
 void initialize(java.lang.Object parameters)
          Called to initialize any necessary state.
 boolean isValidSession(java.lang.String sessionKey)
          Determines if a specified sessionKey is valid (active).
 void removeAggregation(java.lang.String sessionKey)
          Terminates the data aggregation represented by sessionKey.
 void setAggregatorSink(AggregatorSink sink, java.lang.Object sinkParameters)
          Sets the AggregatorSink instance where data from the Aggregator Source will be routed.
private  void setAnonymous(javax.xml.rpc.Stub stub)
           
 void terminate()
          Called to free resources used by the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialized

private boolean initialized

sink

private AggregatorSink sink

sinkParameters

private java.lang.Object sinkParameters

resDescFilename

private java.lang.String resDescFilename

sessions

private java.util.Hashtable sessions

consumer

private NotificationConsumerManager consumer

localEPR

private org.globus.axis.message.addressing.EndpointReferenceType localEPR

locator

WSBaseNotificationServiceAddressingLocator locator

lifetimeLocator

WSResourceLifetimeServiceAddressingLocator lifetimeLocator

logger

private static org.apache.commons.logging.Log logger
Constructor Detail

SubscriptionAggregatorSource

public SubscriptionAggregatorSource(AggregatorSink sink,
                                    java.lang.Object sinkParameters)
Creates a new instance of SubscriptionAggregatorSource


SubscriptionAggregatorSource

public SubscriptionAggregatorSource(AggregatorSink sink)
Method Detail

initialize

public void initialize(java.lang.Object parameters)
                throws AggregatorException,
                       java.lang.Exception
Description copied from interface: AggregatorSource
Called to initialize any necessary state. This method should also attempt to initialize the specified sink and should always throw an exception if the sink is not set. The underlying implementation should throw an AggregatorSinkTypeNotSupportedException if it is not compatible with the supplied AggregationSink. The implementation may use the optional parameters Object to read implementation specific data from or just ignore the processing of it altogether.

Specified by:
initialize in interface AggregatorSource
Throws:
AggregatorException
java.lang.Exception

getSessionContext

public AggregatorServiceGroupEntryResource getSessionContext(java.lang.String sessionKey)
Description copied from interface: AggregatorSource
Retrieve AggregatorServiceGroupEntryResource entry context.

Specified by:
getSessionContext in interface AggregatorSource
Parameters:
sessionKey - The session key of the aggregation.
Returns:
A valid object, or NULL. The type of object returned is dependent on the underlying implementation.

getSessionKey

public java.lang.String getSessionKey(AggregatorServiceGroupEntryResource entry)
                               throws AggregatorException
Description copied from interface: AggregatorSource
Get a sessionKey from a given entry context.

Specified by:
getSessionKey in interface AggregatorSource
Returns:
A string representing the sessionKey for the given entry.
Throws:
AggregatorException

isValidSession

public boolean isValidSession(java.lang.String sessionKey)
                       throws AggregatorException
Description copied from interface: AggregatorSource
Determines if a specified sessionKey is valid (active).

Specified by:
isValidSession in interface AggregatorSource
Returns:
A boolean value indicating whether the specified sessionKey is valid.
Throws:
AggregatorException

getAggregatorSink

public AggregatorSink getAggregatorSink()
Description copied from interface: AggregatorSource
Gets the AggregatorSink instance where data from the underlying AggregatorSource will be routed, or NULL if not set.

Specified by:
getAggregatorSink in interface AggregatorSource

setAggregatorSink

public void setAggregatorSink(AggregatorSink sink,
                              java.lang.Object sinkParameters)
Description copied from interface: AggregatorSource
Sets the AggregatorSink instance where data from the Aggregator Source will be routed.

Specified by:
setAggregatorSink in interface AggregatorSource

addAggregation

public java.lang.String addAggregation(java.lang.Object parameters,
                                       AggregatorServiceGroupEntryResource entry)
                                throws AggregatorParamTypeNotSupportedException,
                                       AggregatorException,
                                       java.lang.Exception
Description copied from interface: AggregatorSource
Establishes an implementation-specific data aggregation session. The method of data collection and consumption is defined by the implementation; the contract of the interface is that any data generated should be capable of being consumed by a class implementing the AggregationSink interface, which will in turn be bound an AggregationSource.

Specified by:
addAggregation in interface AggregatorSource
Parameters:
parameters - Implementation-specific parameters of the data to be collected.
entry - The AggregatorServiceGroupEntryResource instance to associate with this aggregation session. This instance will be passed unmodified to any connected AggregationSink.
Returns:
A session key, which is a String which must be guaranteed by the underlying AggregatorSource implementation to be a unique token with respect to all other invocations of the addAggregation method with the same parameters and entry instance on the same AggregationSource instance. A null return value is not permitted, though the empty string "" is.
An exception MUST be thrown if the aggregation could not be created by the implementation.
Throws:
AggregatorParamTypeNotSupportedException
AggregatorException
java.lang.Exception

removeAggregation

public void removeAggregation(java.lang.String sessionKey)
                       throws AggregatorException,
                              java.lang.Exception
Description copied from interface: AggregatorSource
Terminates the data aggregation represented by sessionKey.

Specified by:
removeAggregation in interface AggregatorSource
Parameters:
sessionKey - The session key of the aggregation to terminate.
Throws:
AggregatorException
java.lang.Exception

terminate

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

Specified by:
terminate in interface AggregatorSource

setAnonymous

private void setAnonymous(javax.xml.rpc.Stub stub)