de.fhg.igd.atlas.core
Class StorageDBEvent

java.lang.Object
  extended byde.fhg.igd.event.Event
      extended byde.fhg.igd.atlas.core.StorageDBEvent
All Implemented Interfaces:
Implication, Serializable

public final class StorageDBEvent
extends Event

This class represents a database event. Database events are triggered when the state of the corresponding database has changed. Each event carries a StorageDBImmutableEntry representing the entry within the database which has been added, changed or deleted as well as the identifier of the action which led to the new state.

Version:
"$Id: StorageDBEvent.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
Serialized Form

Field Summary
static int ALL
           
private  StorageDBImmutableEntry dbEntry_
          The imutable database entry corresponding to the StorageDBEntry managed by the database, which triggered this event.
static int DELETE
           
static int INIT
           
private  int mask_
          The bit mask of those parameters this event refers to.
private static String[] op_id
          The tokens which specify event parameters.
private static int[] op_mask
          Each event parameter corresponds to a bit mask which is used for quick implication testing.
static int REFRESH
           
static int TIMEOUT
           
static int UPDATE
           
 
Fields inherited from class de.fhg.igd.event.Event
millis
 
Constructor Summary
StorageDBEvent(StorageDBImmutableEntry dbEntry, String action)
          Creates an instance.
 
Method Summary
 boolean equals(Object o)
          Tests if this object is equal to the given one which is true iff their classes match, their masks match and their agent names match.
 StorageDBImmutableEntry getDBEntry()
          Returns the entry of the database which is subject of this event.
 int getMask()
          Returns the mask of this object.
 boolean implies(Object o)
          Checks whether this object implies the given one.
 boolean isDelete()
          Return true if this event's DELETE flag is set.
 boolean isInit()
          Return true if this event's INIT flag is set.
 boolean isRefresh()
          Return true if this event's REFRESH flag is set.
 boolean isTimeout()
          Return true if this event's TIMEOUT flag is set.
 boolean isUpdate()
          Return true if this event's UPDATE flag is set.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INIT

public static final int INIT
See Also:
Constant Field Values

UPDATE

public static final int UPDATE
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

REFRESH

public static final int REFRESH
See Also:
Constant Field Values

TIMEOUT

public static final int TIMEOUT
See Also:
Constant Field Values

ALL

public static final int ALL
See Also:
Constant Field Values

op_id

private static final String[] op_id
The tokens which specify event parameters.


op_mask

private static final int[] op_mask
Each event parameter corresponds to a bit mask which is used for quick implication testing.


dbEntry_

private transient StorageDBImmutableEntry dbEntry_
The imutable database entry corresponding to the StorageDBEntry managed by the database, which triggered this event.


mask_

private int mask_
The bit mask of those parameters this event refers to.

Constructor Detail

StorageDBEvent

public StorageDBEvent(StorageDBImmutableEntry dbEntry,
                      String action)
Creates an instance. dbEntry represents the entry of the database which is subject of this event. action is a comma seperated list of strings representing the actions which led to the new state of the database (see op_id).

Parameters:
dbEntry - The entry which has been added, changed or deleted and thereby led to a new state of the database.
action - The event's actions.
Method Detail

implies

public boolean implies(Object o)
Checks whether this object implies the given one. This is exactly the case if:

equals

public boolean equals(Object o)
Tests if this object is equal to the given one which is true iff their classes match, their masks match and their agent names match.

Parameters:
o - The object which is tested for equality.

getMask

public int getMask()
Returns the mask of this object.

Returns:
The mask.

getDBEntry

public StorageDBImmutableEntry getDBEntry()
Returns the entry of the database which is subject of this event.

Returns:
The database entry.

toString

public String toString()
Returns a string representation of this object.

Returns:
The String representation.

isInit

public boolean isInit()
Return true if this event's INIT flag is set.

Returns:
true if this event signals INIT.

isUpdate

public boolean isUpdate()
Return true if this event's UPDATE flag is set.

Returns:
true if this event signals UPDATE.

isDelete

public boolean isDelete()
Return true if this event's DELETE flag is set.

Returns:
true if this event signals DELETE.

isRefresh

public boolean isRefresh()
Return true if this event's REFRESH flag is set.

Returns:
true if this event signals REFRESH.

isTimeout

public boolean isTimeout()
Return true if this event's TIMEOUT flag is set.

Returns:
true if this event signals TIMEOUT.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.