at.ac.tuwien.infosys.sm4all.copal.api.event.xml
Class XMLContextEvent

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.event.ActionList<ContextEventAction,UnprocessedAction>
      extended by at.ac.tuwien.infosys.sm4all.copal.api.event.BaseEvent
          extended by at.ac.tuwien.infosys.sm4all.copal.api.event.ContextEvent
              extended by at.ac.tuwien.infosys.sm4all.copal.api.event.xml.XMLContextEvent

public class XMLContextEvent
extends ContextEvent

Class which must be used to wrap a Document event so COPAL can inject Elements needed for processing of the event. Each XMLContextEvent also has a XMLContextEventType associated with it to be able to easily distinguish XMLContextEvents of same type.

Author:
sanjin

Field Summary
static XMLElement<?>[] XML_ELEMENTS
          all COPAL Elements that are injected and/or can be retrieved from a generated Document.
 
Constructor Summary
XMLContextEvent(XMLContextEventType eventType, Document document)
          Create instance of the XMLContextEvent with specified XMLContextEventType and Document.
XMLContextEvent(XMLContextEventType eventType, String sourceID, Date timeStamp, Document document)
          Create instance of XMLContextEvent with specified XMLContextEventType, source ID, time stamp and Document.
XMLContextEvent(XMLContextEventType eventType, String sourceID, Document document)
          Create instance of XMLContextEvent with specified XMLContextEventType, source ID and Document.
 
Method Summary
 Document getDocument()
           
 XMLContextEventType getType()
          Returns the XMLContextEventType associated with this XMLContextEvent.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.event.ContextEvent
addAuthorization, equals, getAttribute, getAttributes, getAuthorization, getAuthorizations, getPriority, getTTL, hasAttribute, hasAuthorization, hasAuthorizations, hashCode, removeAuthorization, setAttribute, setPriority, setTTL
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.event.BaseEvent
appendAction, appendActions, getCurrentAction, getCurrentActionIndex, getSourceID, getTimeStamp, insertAction, nextAction, removeAction, removeActions, replaceAction, setActions
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.event.ActionList
getAction, getActions, hasAction, numberOfActions, setAction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ELEMENTS

public static final XMLElement<?>[] XML_ELEMENTS
all COPAL Elements that are injected and/or can be retrieved from a generated Document.

Constructor Detail

XMLContextEvent

public XMLContextEvent(XMLContextEventType eventType,
                       Document document)
                throws MalformedDocumentException
Create instance of the XMLContextEvent with specified XMLContextEventType and Document. The specified Document is deep cloned, thus ensuring that any later changes on this instance will not be reflected in Document saved in the XMLContextEvent.

Parameters:
eventType - the XMLContextEventType of this XMLContextEvent.
document - the event Document.
Throws:
MalformedDocumentException - if specified Document is malformed XMLContextEvent.
NullPointerException - if specified Document is null.

XMLContextEvent

public XMLContextEvent(XMLContextEventType eventType,
                       String sourceID,
                       Document document)
                throws MalformedDocumentException
Create instance of XMLContextEvent with specified XMLContextEventType, source ID and Document. The specified Document is deep cloned, thus ensuring that any later changes on this instance will not be reflected in Document saved in the XMLContextEvent.

Parameters:
eventType - the XMLContextEventType of this XMLContextEvent.
sourceID - the source ID of the XMLContextEvent.
document - the event Document.
Throws:
MalformedDocumentException - if specified Document is malformed for specified ContextEventType.
NullPointerException - if specified XMLContextEventType, source ID, or Document is null.
IllegalArgumentException - if specified source ID is an empty or blank string.

XMLContextEvent

public XMLContextEvent(XMLContextEventType eventType,
                       String sourceID,
                       Date timeStamp,
                       Document document)
                throws MalformedDocumentException
Create instance of XMLContextEvent with specified XMLContextEventType, source ID, time stamp and Document. The given Document is deep cloned, thus ensuring that any later changes on this instance will not be reflected in Document saved in the XMLContextEvent.

Parameters:
eventType - the XMLContextEventType of the XMLContextEvent.
sourceID - the source ID of the XMLContextEvent.
timeStamp - the time stamp for the XMLContextEvent.
document - the event as XML DOM document.
Throws:
MalformedDocumentException - if specified Document is malformed for specified XMLContextEventType.
NullPointerException - if specified event type, source ID, time stamp or document is null.
IllegalArgumentException - if specified source ID is an empty or blank string.
Method Detail

getType

public XMLContextEventType getType()
Returns the XMLContextEventType associated with this XMLContextEvent.

Overrides:
getType in class ContextEvent
Returns:
the XMLContextEventType associated with this XMLContextEvent.

getDocument

public Document getDocument()
Returns:
Document with all COPAL Elements injected.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.