gate.event
Class DatastoreEvent

java.lang.Object
  extended by java.util.EventObject
      extended by gate.event.GateEvent
          extended by 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
protected  Resource resource
           
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
protected  Object resourceID
           
 
Fields inherited from class gate.event.GateEvent
FEATURES_UPDATED, type
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DatastoreEvent(DataStore source, int type, Resource res, Object resourceID)
          Constructor.
 
Method Summary
 Resource getResource()
          Gets the resource involved in this event
 Object 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resource

protected Resource resource

resourceID

protected Object resourceID

RESOURCE_ADOPTED

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

See Also:
Constant Field Values

RESOURCE_DELETED

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

See Also:
Constant Field Values

RESOURCE_WRITTEN

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

See Also:
Constant Field Values
Constructor Detail

DatastoreEvent

public DatastoreEvent(DataStore source,
                      int type,
                      Resource res,
                      Object 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 Object getResourceID()
Gets the ID of the resource involved in this event


getResource

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