Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Purpose

In order to be able to query retrieve event histories, we maintain a persistent store of events received over the event bus connecting linking clients, services and containers is maintained. This store is provided with a simple (Axis) web-service façade (no authentication required).

The position of this repository service can be seen in the events & messaging diagram as the "Simple Event Store"; the implementation of the service subscribes to the bus and stores all events sent over it.

...

In most cases, the user will interact with this service through a specially designed Siege views (refer to the tutorial for specifics). Programmatic interactions also take place via the web service ports from the Workflow Broker when cleanup or archive routines are called. A brief description of the API follows.

API

Service WSDL

EventRepository

Code Block

public interface EventRepository
{
   public EventDescriptor[] select( EventQuery query );
   public EventDescriptor[] remove( EventQuery query );
   public void removeNoReply( EventQuery query );
   public String logEvents( EventQuery query );
   public long count( EventQuery query );
} 

removeNoReply is useful when cleaning up the database (returning all events will with a high probability generate an out-of-memory error in the client).

The return value of the logEvents method is the URL where the log file may be found.

...

EventDescriptor

Code Block
public interfaceclass EventRepositoryEventDescriptor
{
   public EventDescriptor[]LocalEvent select( EventQuery query toLocalEvent() throws DeserializationException,
      UnknownExtensionException, InstantiationException,
      IllegalAccessException, ClassNotFoundException;
   public String getClassName();
   public EventDescriptor[]void removesetClassName( EventQuery query String className );
   public String getXml();
   public void removeNoReplysetXml( EventQueryString queryxml );
   public StringInteger logEventsgetId( EventQuery query );
   public longvoid countsetId( EventQueryInteger queryid );
} 

...

A simple wrapper around the LocalEvent object. Class name identifies the type of local event (necessary for deserialization).

...

EventQuery

Code Block
public class EventDescriptor
{EventQuery
{
   public void clear();
   public String getBaseUri();
   public void setBaseUri( String baseUri );
   public String getGroupId();
   public void setGroupId( String group );
   public String getNode();
   public void setNode( String node );
   public LocalEvent toLocalEvent() throws DeserializationException, String getProducer();
   public void setProducer( String producer );
   public String getScript();
   public void setScript( String script );
   public String getTask();
   public void  UnknownExtensionException, InstantiationException,setTask( String task );
   public String getTopic();
   public void  IllegalAccessException, ClassNotFoundExceptionsetTopic( String topic );
   public String getClassNamegetType();
   public void setClassNamesetType( String classNametype );
   public String getXmlgetWorkflow();
   public void setXmlsetWorkflow( String xml workflow );
   public Long getAfter();
   public void setAfter( Long after );
   public Long getBefore();
   public void setBefore( Long before );
   public Integer getIdgetLastId();
   public void setIdsetLastId( Integer idlastId );
}

A simplified version of the LocalEventFilter: it corresponds to a single ncsa.tools.events.types.filters.LocalEventHeaderComparator, a conjunction of comparisons on the header properties represented by the set- and get- methods. The lastId field is used by the service client for more scalable pulls (there is a default batch size of 100 events at a time).

A subclass of EventQuery, ncsa.services.events.utilities.EventQueryAdapter, allows for conversion between this object and a LocalEventFilter as well as providing several flags useful for interaction with the service (for instance, it is often the case that one will wish to receive all events generated up to this point in time, but to continue listening for incoming events matching that filter as well); this utility class, in fact, is used under the covers by several Siege views.

Code Block

public class EventQueryAdapter extends EventQuery
{
   public EventQuery toQuery();
   public LocalEventFilter toFilter();
   public boolean isGetHistory();
   public void setGetHistory( boolean getHistory );
   public boolean isKeepListening();
   public void setKeepListening( boolean keepListening );
   public String getEventRepositoryUrl();
   public void setEventRepositoryUrl( String eventRepositoryUrl );
   public boolean isRemoveEvents();
   public void setRemoveEvents( boolean removeEvents );
   public GSSCredential getCredential();
   public void setCredential( GSSCredential credential );
}