at.ac.tuwien.infosys.sm4all.copal.api.service
Interface ContextQueryFactory

All Superinterfaces:
Observable<QueryState,ContextQuery,QueryObserver>
All Known Implementing Classes:
ContextQueryFactoryImpl

public interface ContextQueryFactory
extends Observable<QueryState,ContextQuery,QueryObserver>

Interface which COPAL core provides to create ContextQuerys which can be used to register and unregister ContextListeners.

Author:
sanjin

Method Summary
 ProcessedEventQuery create(java.lang.String name, java.lang.String listenedType)
          Create instance of ProcessedEventQuery with specified globally unique name which catches all events with specified name of ContextEventType.
 ProcessedEventQuery create(java.lang.String name, java.lang.String listenedType, java.lang.String criteria)
          Create instance of ProcessedEventQuery with specified globally unique name which catches all events with specified name ContextEventType for which specified criteria evaluates to true.
 ActionQuery createActionQuery(java.lang.String listenedType, java.lang.String actionName)
          Create instance of ActionQuery for ContextEvents that have name of their ContextEventType equal to specified listened type and have name of their CurrentAction equal to specified action name
 ContextQuery[] getQueries()
          Returns all currently non-destroyed ContextQuerys.
 ContextQuery[] getQueries(java.lang.String eventType)
           
 ContextQuery getQuery(java.lang.String name)
           
 
Methods inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.util.Observable
attach, detach
 

Method Detail

create

ProcessedEventQuery create(java.lang.String name,
                           java.lang.String listenedType)
                           throws RedefinitionOfQueryException
Create instance of ProcessedEventQuery with specified globally unique name which catches all events with specified name of ContextEventType. If a query with same name was previously created the instance of ContextQuery created in first call will be returned, thus caller of this method has to ensure that specified event type in both calls is same.

Parameters:
name - the globally unique name of the ProcessedEventQuery.
listenedType - the name of listened ContextEventType.
Returns:
the context query.
Throws:
RedefinitionOfQueryException - if query with same name and different event type is already created.
See Also:
ProcessedEventQuery.ProcessedEventQuery(String, String)

create

ProcessedEventQuery create(java.lang.String name,
                           java.lang.String listenedType,
                           java.lang.String criteria)
                           throws RedefinitionOfQueryException
Create instance of ProcessedEventQuery with specified globally unique name which catches all events with specified name ContextEventType for which specified criteria evaluates to true. Criteria is a logical expression using event's properties to further separate the events of interest. If a query with same name was previously created the instance of ContextQuery created in first call will be returned, thus caller of this method has to ensure that specified event type and criteria in both calls are same.

Parameters:
name - the globally unique name of the ProcessedEventQuery.
listenedType - the name of listened ContextEventType.
criteria - the logical expression.
Returns:
the context query.
Throws:
RedefinitionOfQueryException - if query with same name and different event type or criteria is already created.
See Also:
ProcessedEventQuery.ProcessedEventQuery(String, String, String)

createActionQuery

ActionQuery createActionQuery(java.lang.String listenedType,
                              java.lang.String actionName)
Create instance of ActionQuery for ContextEvents that have name of their ContextEventType equal to specified listened type and have name of their CurrentAction equal to specified action name

Parameters:
listenedType - the name of listened ContextEventType.
actionName - the name of handled CurrentAction.
Returns:
the action query.
See Also:
ActionQuery.ActionQuery(String, String)

getQueries

ContextQuery[] getQueries()
Returns all currently non-destroyed ContextQuerys.

Returns:
all currently non-destroyed ContextQuerys.

getQuery

ContextQuery getQuery(java.lang.String name)
Parameters:
name - the name of a ContextQuery.
Returns:
the ContextQuery used in creation; or null if there is no non-destroyed ContextQuery with specified name.

getQueries

ContextQuery[] getQueries(java.lang.String eventType)
Parameters:
eventType - the name of the ContextEventType.
Returns:
all ContextQuerys which listen on events of ContextEventType that has name equal to specified eventType.


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