gate.event
Class DatastoreEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--gate.event.GateEvent
              |
              +--gate.event.DatastoreEvent
All Implemented Interfaces:
Serializable

public class DatastoreEvent
extends GateEvent

This class models events fired by datastores. Such events occur when new resources are adopted by a datastore or when an existing resource from the datastore is deleted.

See Also:
Serialized Form

Field Summary
static int RESOURCE_ADOPTED
          The type of events fired when a resource has been adopted
static int RESOURCE_DELETED
          The type of events fired when a resource has been deleted from a datastore
static int RESOURCE_WRITTEN
          The type of events fired when a resource has wrote into the datastore
 
Constructor Summary
DatastoreEvent(DataStore source, int type, Resource res, String resourceID)
          Constructor.
 
Method Summary
 Resource getResource()
          Gets the resource involved in this event
 String getResourceID()
          Gets the ID of the resource involved in this event
 
Methods inherited from class gate.event.GateEvent
getType
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE_ADOPTED

public static int RESOURCE_ADOPTED
The type of events fired when a resource has been adopted

RESOURCE_DELETED

public static int RESOURCE_DELETED
The type of events fired when a resource has been deleted from a datastore

RESOURCE_WRITTEN

public static int RESOURCE_WRITTEN
The type of events fired when a resource has wrote into the datastore
Constructor Detail

DatastoreEvent

public DatastoreEvent(DataStore source,
                      int type,
                      Resource res,
                      String resourceID)
Constructor.
Parameters:
source - the datastore that originated the event.
type - the event type.
res - the resource that has been adopted/deleted/etc.
resourceID - the ID corresponding to the resource in this datastore
Method Detail

getResourceID

public String getResourceID()
Gets the ID of the resource involved in this event

getResource

public Resource getResource()
Gets the resource involved in this event