at.ac.tuwien.infosys.sm4all.copal.rest.model
Class RESTPublisher

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.helpers.AbstractXMLPublisher
      extended by at.ac.tuwien.infosys.sm4all.copal.rest.model.RESTPublisher
All Implemented Interfaces:
ContextPublisher

public class RESTPublisher
extends AbstractXMLPublisher

ContextPublisher that is used by REST service to publish Events.

Author:
sanjin

Constructor Summary
RESTPublisher(String sourceID, String type)
          Creates an instance of RESTPublisher that publishes Event s of specified type and using specified source ID.
 
Method Summary
 void publish(Event event)
          Publish specified Event.
protected  boolean start(XMLContextEventType type)
          This method is called when EventPublisher becomes available for publishing events of the specified XMLContextEventType.
protected  void stop(XMLContextEventType type)
          This method is called when EventPublisher becomes unavailable for publishing events of the specified XMLContextEventType.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.helpers.AbstractXMLPublisher
getEventType, getSourceID, isStarted, publish, publish, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RESTPublisher

public RESTPublisher(String sourceID,
                     String type)
Creates an instance of RESTPublisher that publishes Event s of specified type and using specified source ID.

Parameters:
sourceID - the source ID.
type - the type of published Events.
Method Detail

start

protected boolean start(XMLContextEventType type)
Description copied from class: AbstractXMLPublisher
This method is called when EventPublisher becomes available for publishing events of the specified XMLContextEventType. This method should be implemented by specific publishers and should be used as a notification that publisher can, from now on, publish events.

Specified by:
start in class AbstractXMLPublisher
Parameters:
type - the XMLContextEventType of published events.

stop

protected void stop(XMLContextEventType type)
Description copied from class: AbstractXMLPublisher
This method is called when EventPublisher becomes unavailable for publishing events of the specified XMLContextEventType. This method should be implemented by specific publishers and should be used as a notification that publisher should not publish any more events.

Specified by:
stop in class AbstractXMLPublisher
Parameters:
type - the XMLContextEventType of published events.

publish

public void publish(Event event)
             throws MalformedDocumentException
Publish specified Event.

Parameters:
event - the Event.
Throws:
MalformedDocumentException - if specified Event is not valid for specified type of published Events.


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