Coalevo Logo

net.coalevo.messaging.model
Class BaseEventInfo

java.lang.Object
  extended by net.coalevo.messaging.model.BaseEventInfo
All Implemented Interfaces:
EventInfo

public abstract class BaseEventInfo
extends java.lang.Object
implements EventInfo

Abstract base class for EventInfo implementations.

Standardizes the equals(Object) method to compare identifier, to and from.

Version:
1.0.0 (10/02/2009)
Author:
Dieter Wimberger (wimpi)

Constructor Summary
protected BaseEventInfo(java.lang.String identifier, AgentIdentifier from, AgentIdentifier to)
          Constructs the instance with final information.
protected BaseEventInfo(java.lang.String identifier, AgentIdentifier from, AgentIdentifier to, boolean b)
          Constructs the instance with final information.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 long getCreated()
          Returns the system time when this object was created.
 AgentIdentifier getFrom()
          Returns the sender.
 java.lang.String getIdentifier()
          Returns an identifier that corresponds to a specific message (to be send, cancelled, to be confirmed).
 AgentIdentifier getTo()
          Returns the addressee.
 int hashCode()
           
 boolean isMulticast()
          Flag that indicates whether this info is related to a multicast or not.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEventInfo

protected BaseEventInfo(java.lang.String identifier,
                        AgentIdentifier from,
                        AgentIdentifier to)
Constructs the instance with final information.

Parameters:
identifier - the identifier of a message/event.
from - the sender as AgentIdentifier.
to - the addressee as AgentIdentifier.

BaseEventInfo

protected BaseEventInfo(java.lang.String identifier,
                        AgentIdentifier from,
                        AgentIdentifier to,
                        boolean b)
Constructs the instance with final information.

Parameters:
identifier - the identifier of a message/event.
from - the sender as AgentIdentifier.
to - the addressee as AgentIdentifier.
b - a flag that indicates if this is a multicast generated event info.
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Description copied from interface: EventInfo
Returns an identifier that corresponds to a specific message (to be send, cancelled, to be confirmed).

Specified by:
getIdentifier in interface EventInfo
Returns:
a unique identifier.

getTo

public AgentIdentifier getTo()
Description copied from interface: EventInfo
Returns the addressee.

Specified by:
getTo in interface EventInfo
Returns:
the addressee as AgentIdentifier.

getFrom

public AgentIdentifier getFrom()
Description copied from interface: EventInfo
Returns the sender.

Specified by:
getFrom in interface EventInfo
Returns:
the sender as AgentIdentifier.

isMulticast

public boolean isMulticast()
Description copied from interface: EventInfo
Flag that indicates whether this info is related to a multicast or not.

Specified by:
isMulticast in interface EventInfo
Returns:
true if related to a multicast, false otherwise.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getCreated

public long getCreated()
Description copied from interface: EventInfo
Returns the system time when this object was created.

Specified by:
getCreated in interface EventInfo
Returns:
the system time in milliseconds (from UTC).

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Coalevo Logo

(c) 2004-2009 VFI (http://www.vfi.or.at)