com.bigbross.bossa.notify
Class Event

java.lang.Object
  extended bycom.bigbross.bossa.notify.Event
All Implemented Interfaces:
Comparable, Serializable

public class Event
extends Object
implements Comparable, Serializable

This class represents an event in the notification bus.

Author:
BigBross Team
See Also:
Serialized Form

Field Summary
static int RESOURCE_EVENT
          Constant to indicate a resource manipulation event type.
static int WFNET_EVENT
          Constant to indicate a work item or activity related event type.
 
Constructor Summary
Event(String id, int type, Map attributes, Date time)
          Creates an event.
 
Method Summary
 int compareTo(Object o)
          Note: this class has a natural ordering that is inconsistent with equals.
 Map getAttributes()
          Returns the attributes map of this event.
 String getId()
          Returns the id of this event.
 Date getTime()
          Returns the time this event happened.
 int getType()
          Returns the type of this event.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WFNET_EVENT

public static final int WFNET_EVENT
Constant to indicate a work item or activity related event type.

See Also:
Constant Field Values

RESOURCE_EVENT

public static final int RESOURCE_EVENT
Constant to indicate a resource manipulation event type.

See Also:
Constant Field Values
Constructor Detail

Event

public Event(String id,
             int type,
             Map attributes,
             Date time)
Creates an event. For a list of the possible event types, see the constants defined in this class.

The meaning of the id and of the attributes map are defined by the generator of the event. The only exception is that a event with type WFNET_EVENT should contain an attribute named WFNetEvents.ATTRIB_RESOURCE_ID, indicating the resource this event affects. Also all attribute mappings are String id to String value.

Parameters:
id - the id of this event.
type - the type os this event.
attributes - a Map containing the attributes.
time - the time this event happened.
See Also:
WFNetEvents.ATTRIB_RESOURCE_ID
Method Detail

getId

public String getId()
Returns the id of this event.

Returns:
the id of this event.

getType

public int getType()
Returns the type of this event.

Returns:
the type of this event.

getAttributes

public Map getAttributes()
Returns the attributes map of this event.

Notice that it is not possible to change this map. If tried, an UnsupportedOperationException will be thrown.

Returns:
the attributes map of this event.

getTime

public Date getTime()
Returns the time this event happened.

Returns:
the time this event happened.

compareTo

public int compareTo(Object o)
Note: this class has a natural ordering that is inconsistent with equals.

Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)


Copyright © 2003,2004 OpenBR Sistemas S/C Ltda.