at.ac.tuwien.infosys.sm4all.copal.rest.internal
Class ServiceImpl

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.rest.internal.ServiceImpl
All Implemented Interfaces:
Service

public class ServiceImpl
extends java.lang.Object
implements Service

Implementation of the Service interface.

Author:
sanjin

Constructor Summary
ServiceImpl()
           
 
Method Summary
 javax.ws.rs.core.Response create(javax.ws.rs.core.UriInfo uriInfo, ProcessedEventQuery query)
          Creates specified ProcessedEventQuery.
 javax.ws.rs.core.Response destroy(java.lang.String name)
          Destroys specified ContextQuery.
 javax.ws.rs.core.Response getEventType(java.lang.String name)
          Returns a Response with registered XMLContextEventType that has specified name.
 ContextEventTypeRegistry getEventTypeRegistry()
          Returns the ContextEventTypeRegistry this service is using.
 javax.ws.rs.core.Response getEventTypes()
          Returns a Response with all registered XMLContextEventTypes.
 javax.ws.rs.core.Response getListener(java.lang.String queryName, java.lang.String name)
          Returns a Response with a ContextListener that has specified name and is registered with ContextQuery that has specified query name.
 javax.ws.rs.core.Response getListeners(java.lang.String queryName)
          Returns a Response with all ContextListeners that are registered with ContextQuery that has specified query name.
 javax.ws.rs.core.Response getProcessor(java.lang.String name)
          Returns a Response with registered ContextProcessor that has specified name.
 ContextProcessorRegistry getProcessorRegistry()
          Returns the ContextProcessorRegistry this service is using.
 javax.ws.rs.core.Response getProcessors()
          Returns a Response with all registered ContextProcessors.
 javax.ws.rs.core.Response getProcessors(java.lang.String eventName)
          Returns a Response with all registered ContextProcessors that process events with specified name.
 javax.ws.rs.core.Response getPublisher(java.lang.String sourceID)
          Returns a Response with registered ContextPublisher that has specified source ID.
 ContextPublisherRegistry getPublisherRegistry()
          Returns the ContextPublisherRegistry this service is using.
 javax.ws.rs.core.Response getPublishers()
          Returns a Response with all registered ContextPublishers.
 javax.ws.rs.core.Response getPublishers(java.lang.String eventName)
          Returns a Response with all registered ContextPublishers that publish events with specified name.
 javax.ws.rs.core.Response getQueries()
          Returns a Response with all non-destroyed ContextQuerys.
 javax.ws.rs.core.Response getQueries(java.lang.String eventName)
          Returns a Response with all non-destroyed ContextQuerys that listen on events with specified name.
 javax.ws.rs.core.Response getQuery(java.lang.String name)
          Returns a Response with non-destroyed ContextQuery that has specified name.
 ContextQueryFactory getQueryFactory()
          Returns the ContextQueryFactory this service is using.
 javax.ws.rs.core.Response publish(java.lang.String sourceID, Event event)
          Publishes specified Event using a RESTfulPublisher that has specified source ID.
 javax.ws.rs.core.Response register(javax.ws.rs.core.UriInfo uriInfo, RESTfulPublisher publisher)
          Registers specified RESTfulPublisher.
 javax.ws.rs.core.Response register(javax.ws.rs.core.UriInfo uriInfo, java.lang.String queryName, RESTfulListener listener)
          Registers specified RESTfulListener with ContextQuery that has specified query name.
 javax.ws.rs.core.Response register(javax.ws.rs.core.UriInfo uriInfo, XMLContextEventType eventType)
          Registers specified XMLContextEventType.
 void setEventTypeRegistry(ContextEventTypeRegistry eventTypeRegistry)
          Sets the ContextEventTypeRegistry this service should use.
 void setProcessorRegistry(ContextProcessorRegistry processorRegistry)
          Sets the ContextProcessorRegistry this service should use.
 void setPublisherRegistry(ContextPublisherRegistry publisherRegistry)
          Sets the ContextPublisherRegistry this service should use.
 void setQueryFactory(ContextQueryFactory queryFactory)
          Sets the ContextQueryFactory this service should use.
 javax.ws.rs.core.Response unregisterEventType(java.lang.String name)
          Unregisters specified XMLContextEventType.
 javax.ws.rs.core.Response unregisterListener(java.lang.String queryName, java.lang.String name)
          Unregisters specified RESTfulListener from ContextQuery that has specified query name.
 javax.ws.rs.core.Response unregisterPublisher(java.lang.String sourceID)
          Unregisters specified RESTfulPublisher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceImpl

public ServiceImpl()
Method Detail

getEventTypeRegistry

public ContextEventTypeRegistry getEventTypeRegistry()
Returns the ContextEventTypeRegistry this service is using.

Returns:
the ContextEventTypeRegistry this service is using.

setEventTypeRegistry

public void setEventTypeRegistry(ContextEventTypeRegistry eventTypeRegistry)
Sets the ContextEventTypeRegistry this service should use.

Parameters:
eventTypeRegistry - the ContextEventTypeRegistry.

getPublisherRegistry

public ContextPublisherRegistry getPublisherRegistry()
Returns the ContextPublisherRegistry this service is using.

Returns:
the ContextPublisherRegistry this service is using.

setPublisherRegistry

public void setPublisherRegistry(ContextPublisherRegistry publisherRegistry)
Sets the ContextPublisherRegistry this service should use.

Parameters:
publisherRegistry - the ContextPublisherRegistry.

getProcessorRegistry

public ContextProcessorRegistry getProcessorRegistry()
Returns the ContextProcessorRegistry this service is using.

Returns:
the ContextProcessorRegistry this service is using.

setProcessorRegistry

public void setProcessorRegistry(ContextProcessorRegistry processorRegistry)
Sets the ContextProcessorRegistry this service should use.

Parameters:
processorRegistry - the ContextProcessorRegistry.

getQueryFactory

public ContextQueryFactory getQueryFactory()
Returns the ContextQueryFactory this service is using.

Returns:
the ContextQueryFactory this service is using.

setQueryFactory

public void setQueryFactory(ContextQueryFactory queryFactory)
Sets the ContextQueryFactory this service should use.

Parameters:
queryFactory - the ContextQueryFactory.

getEventTypes

public javax.ws.rs.core.Response getEventTypes()
Description copied from interface: Service
Returns a Response with all registered XMLContextEventTypes.

Specified by:
getEventTypes in interface Service
Returns:
the Response with all registered XMLContextEventTypes.

register

public javax.ws.rs.core.Response register(javax.ws.rs.core.UriInfo uriInfo,
                                          XMLContextEventType eventType)
Description copied from interface: Service
Registers specified XMLContextEventType.

Specified by:
register in interface Service
Parameters:
uriInfo - the UriInfo to create URI to registered XMLContextEventType.
eventType - the XMLContextEventType.
Returns:
the Response.

getEventType

public javax.ws.rs.core.Response getEventType(java.lang.String name)
Description copied from interface: Service
Returns a Response with registered XMLContextEventType that has specified name.

Specified by:
getEventType in interface Service
Parameters:
name - the name of the XMLContextEventType.
Returns:
the Response with registered XMLContextEventType with specified name.

unregisterEventType

public javax.ws.rs.core.Response unregisterEventType(java.lang.String name)
Description copied from interface: Service
Unregisters specified XMLContextEventType.

Specified by:
unregisterEventType in interface Service
Parameters:
name - the name of the XMLContextEventType.
Returns:
the Response with unregistered XMLContextEventType.

getProcessors

public javax.ws.rs.core.Response getProcessors(java.lang.String eventName)
Description copied from interface: Service
Returns a Response with all registered ContextProcessors that process events with specified name.

Specified by:
getProcessors in interface Service
Parameters:
eventName - the name of processed events.
Returns:
the Response with all registered ContextProcessor s that process events with specified name.

getQueries

public javax.ws.rs.core.Response getQueries(java.lang.String eventName)
Description copied from interface: Service
Returns a Response with all non-destroyed ContextQuerys that listen on events with specified name.

Specified by:
getQueries in interface Service
Parameters:
eventName - the name of listened events.
Returns:
the Response with all registered ContextQuery s that listen on events with specified name.

getPublishers

public javax.ws.rs.core.Response getPublishers(java.lang.String eventName)
Description copied from interface: Service
Returns a Response with all registered ContextPublishers that publish events with specified name.

Specified by:
getPublishers in interface Service
Parameters:
eventName - the name of published events.
Returns:
the Response with all registered ContextPublisher s that publish events with specified name.

getPublishers

public javax.ws.rs.core.Response getPublishers()
Description copied from interface: Service
Returns a Response with all registered ContextPublishers.

Specified by:
getPublishers in interface Service
Returns:
the Response with all registered ContextPublisher s.

register

public javax.ws.rs.core.Response register(javax.ws.rs.core.UriInfo uriInfo,
                                          RESTfulPublisher publisher)
Description copied from interface: Service
Registers specified RESTfulPublisher.

Specified by:
register in interface Service
Parameters:
uriInfo - the UriInfo to create URI to registered RESTfulPublisher.
publisher - the RESTfulPublisher.
Returns:
the Response.

getPublisher

public javax.ws.rs.core.Response getPublisher(java.lang.String sourceID)
Description copied from interface: Service
Returns a Response with registered ContextPublisher that has specified source ID.

Specified by:
getPublisher in interface Service
Parameters:
sourceID - the source ID of the ContextPublisher.
Returns:
the Response with registered ContextPublisher with specified source ID.

publish

public javax.ws.rs.core.Response publish(java.lang.String sourceID,
                                         Event event)
Description copied from interface: Service
Publishes specified Event using a RESTfulPublisher that has specified source ID.

Specified by:
publish in interface Service
Parameters:
sourceID - the source ID of the RESTfulPublisher.
event - the Event to be published.
Returns:
the Response.

unregisterPublisher

public javax.ws.rs.core.Response unregisterPublisher(java.lang.String sourceID)
Description copied from interface: Service
Unregisters specified RESTfulPublisher.

Specified by:
unregisterPublisher in interface Service
Parameters:
sourceID - the source ID of the RESTfulPublisher.
Returns:
the Response with unregistered RESTfulPublisher.

getProcessors

public javax.ws.rs.core.Response getProcessors()
Description copied from interface: Service
Returns a Response with all registered ContextProcessors.

Specified by:
getProcessors in interface Service
Returns:
the Response with all registered ContextProcessor s.

getProcessor

public javax.ws.rs.core.Response getProcessor(java.lang.String name)
Description copied from interface: Service
Returns a Response with registered ContextProcessor that has specified name.

Specified by:
getProcessor in interface Service
Parameters:
name - the name of the ContextProcessor.
Returns:
the Response with registered ContextProcessor with specified name.

getQueries

public javax.ws.rs.core.Response getQueries()
Description copied from interface: Service
Returns a Response with all non-destroyed ContextQuerys.

Specified by:
getQueries in interface Service
Returns:
the Response with all non-destroyed ContextQuery s.

create

public javax.ws.rs.core.Response create(javax.ws.rs.core.UriInfo uriInfo,
                                        ProcessedEventQuery query)
Description copied from interface: Service
Creates specified ProcessedEventQuery.

Specified by:
create in interface Service
Parameters:
uriInfo - the UriInfo to create URI to registered ProcessedEventQuery.
query - the ProcessedEventQuery.
Returns:
the Response.

getQuery

public javax.ws.rs.core.Response getQuery(java.lang.String name)
Description copied from interface: Service
Returns a Response with non-destroyed ContextQuery that has specified name.

Specified by:
getQuery in interface Service
Parameters:
name - the name of the ContextQuery.
Returns:
the Response with non-destroyed ContextQuery with specified name.

destroy

public javax.ws.rs.core.Response destroy(java.lang.String name)
Description copied from interface: Service
Destroys specified ContextQuery.

Specified by:
destroy in interface Service
Parameters:
name - the name of ContextQuery.
Returns:
the Response with destroyed ContextQuery.

getListeners

public javax.ws.rs.core.Response getListeners(java.lang.String queryName)
Description copied from interface: Service
Returns a Response with all ContextListeners that are registered with ContextQuery that has specified query name.

Specified by:
getListeners in interface Service
Parameters:
queryName - the name of the ContextQuery.
Returns:
the Response with all ContextListeners that are registered with ContextQuery that has specified name.

register

public javax.ws.rs.core.Response register(javax.ws.rs.core.UriInfo uriInfo,
                                          java.lang.String queryName,
                                          RESTfulListener listener)
Description copied from interface: Service
Registers specified RESTfulListener with ContextQuery that has specified query name.

Specified by:
register in interface Service
Parameters:
uriInfo - the UriInfo to create URI to registered RESTfulListener.
queryName - the name of the ContextQuery.
listener - the RESTfulListener.
Returns:
the Response.

getListener

public javax.ws.rs.core.Response getListener(java.lang.String queryName,
                                             java.lang.String name)
Description copied from interface: Service
Returns a Response with a ContextListener that has specified name and is registered with ContextQuery that has specified query name.

Specified by:
getListener in interface Service
Parameters:
queryName - the name of the ContextQuery.
name - the name of the ContextListener.
Returns:
the Response with the ContextListener that has specified name and is registered with ContextQuery that has specified query name.

unregisterListener

public javax.ws.rs.core.Response unregisterListener(java.lang.String queryName,
                                                    java.lang.String name)
Description copied from interface: Service
Unregisters specified RESTfulListener from ContextQuery that has specified query name.

Specified by:
unregisterListener in interface Service
Parameters:
queryName - the name of the ContextQuery.
name - the name of the ContextListener.
Returns:
the Response with unregistered RESTfulListener.


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