nl.justobjects.pushlet.core
Class Event

java.lang.Object
  extended by nl.justobjects.pushlet.core.Event
All Implemented Interfaces:
java.io.Serializable, Protocol

public class Event
extends java.lang.Object
implements Protocol, java.io.Serializable

Represents the event data.

Version:
$Id: Event.java,v 1.13 2007/11/23 14:33:07 justb Exp $
Author:
Just van den Broecke - Just Objects ©
See Also:
Serialized Form

Field Summary
protected  java.util.Map attributes
           
 
Fields inherited from interface nl.justobjects.pushlet.core.Protocol
DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
 
Constructor Summary
Event(java.util.Map theAttributes)
           
Event(java.lang.String anEventType)
           
Event(java.lang.String anEventType, java.util.Map theAttributes)
           
 
Method Summary
 java.lang.Object clone()
           
static Event createDataEvent(java.lang.String aSubject)
           
static Event createDataEvent(java.lang.String aSubject, java.util.Map theAttributes)
           
 java.lang.String getEventType()
           
 java.lang.String getField(java.lang.String name)
           
 java.lang.String getField(java.lang.String name, java.lang.String aDefault)
          Return field; if null return default.
 java.util.Iterator getFieldNames()
           
 java.lang.String getSubject()
           
private  void setAttrs(java.util.Map theAttributes)
          Copy given attributes into event attributes
 void setField(java.lang.String name, int value)
           
 void setField(java.lang.String name, long value)
           
 void setField(java.lang.String name, java.lang.String value)
           
 java.lang.String toQueryString()
          Convert to HTTP query string.
 java.lang.String toString()
           
 java.lang.String toXML()
           
 java.lang.String toXML(boolean strict)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributes

protected java.util.Map attributes
Constructor Detail

Event

public Event(java.lang.String anEventType)

Event

public Event(java.lang.String anEventType,
             java.util.Map theAttributes)

Event

public Event(java.util.Map theAttributes)
Method Detail

createDataEvent

public static Event createDataEvent(java.lang.String aSubject)

createDataEvent

public static Event createDataEvent(java.lang.String aSubject,
                                    java.util.Map theAttributes)

getEventType

public java.lang.String getEventType()

getSubject

public java.lang.String getSubject()

setField

public void setField(java.lang.String name,
                     java.lang.String value)

setField

public void setField(java.lang.String name,
                     int value)

setField

public void setField(java.lang.String name,
                     long value)

getField

public java.lang.String getField(java.lang.String name)

getField

public java.lang.String getField(java.lang.String name,
                                 java.lang.String aDefault)
Return field; if null return default.


getFieldNames

public java.util.Iterator getFieldNames()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toQueryString

public java.lang.String toQueryString()
Convert to HTTP query string.


toXML

public java.lang.String toXML(boolean strict)

toXML

public java.lang.String toXML()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

setAttrs

private void setAttrs(java.util.Map theAttributes)
Copy given attributes into event attributes



Copyright 2000-2003 - Just Objects B.V.