Valescom Java API

com.valescom.support.event.java
Class Event

java.lang.Object
  |
  +--com.valescom.support.store.java.BaseIdentifyable
        |
        +--com.valescom.support.subscription.java.BasePublication
              |
              +--com.valescom.support.event.java.Event
All Implemented Interfaces:
Cloneable, Comparable, Identifyable, Publication, Serializable, Taggable, Visitable
Direct Known Subclasses:
LocalEvent, RemoteEvent

public abstract class Event
extends BasePublication

Responsibility:
Providing a base class for all event-like objects.
Usage:

Event myEvent = new LocalEvent();
myEvent.publish();

See Also:
Serialized Form
 

Constructor Summary
protected Event()
           
protected Event(Event anEvent)
           
protected Event(String anId)
           
 
Method Summary
 long getTimestamp()
          Returns the timestamp for this Event in milliseconds.
 long getTimeToLive()
          Returns the time to live for this Event in seconds.
 boolean isAuthentic()
          Indicates whether this event is authentic or not.
abstract  void publish()
          Publish this Event to all subscribed EventHandlers that are interested.
 void readExternal(ObjectInput anInput)
           
abstract  boolean remote()
          Get the remote of this Event.
 void setCategories(Categories aCategories)
          Set the categories for this Event.
 void setTimestamp(long aTimestamp)
          Set the timestamp for this Event in milliseconds.
 void setTimeToLive(long aTimeToLive)
          Set the time to live for this Event in seconds.
 void writeExternal(ObjectOutput anOutput)
           
 
Methods inherited from class com.valescom.support.subscription.java.BasePublication
accept, clone, fill, getCategories, tag, toString
 
Methods inherited from class com.valescom.support.store.java.BaseIdentifyable
compareTo, equals, getId, hashCode, referred, referred, setId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.valescom.support.store.java.Identifyable
getId, referred, setId
 

Constructor Detail

Event

protected Event()

Event

protected Event(Event anEvent)

Event

protected Event(String anId)
Method Detail

publish

public abstract void publish()
Publish this Event to all subscribed EventHandlers that are interested. Set the publication timestamp. Note, the timestamp remains unchanged if it has already been set.


remote

public abstract boolean remote()
Get the remote of this Event.

Returns:
false.

isAuthentic

public boolean isAuthentic()
Indicates whether this event is authentic or not.


getTimestamp

public final long getTimestamp()
Returns the timestamp for this Event in milliseconds.

Returns:
The timestamp for this Event.

setTimestamp

public final void setTimestamp(long aTimestamp)
Set the timestamp for this Event in milliseconds.

Pre conditions:
aTimestamp must be greater equal 0.

Parameters:
aTimestamp - The timestamp to set.

getTimeToLive

public final long getTimeToLive()
Returns the time to live for this Event in seconds.

Returns:
The time to live for this Event.

setTimeToLive

public final void setTimeToLive(long aTimeToLive)
Set the time to live for this Event in seconds.

Pre conditions:
aTimeToLive may not be null.

Parameters:
aTimeToLive - The time to live to set.

setCategories

public void setCategories(Categories aCategories)
Set the categories for this Event.

Pre conditions:
aCategories may not be null.

Overrides:
setCategories in class BasePublication
Parameters:
aCategories - The Categories to set.

readExternal

public void readExternal(ObjectInput anInput)
                  throws IOException,
                         ClassNotFoundException
Overrides:
readExternal in class BasePublication
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput anOutput)
                   throws IOException
Overrides:
writeExternal in class BasePublication
IOException

Valescom Java API

Copyright 1998, 2003 - Valescom