MICO Platform  1.0.0
 All Classes Namespaces Functions Variables Friends
Public Member Functions | Protected Attributes | List of all members
mico::event::AnalysisService Class Referenceabstract

Interface to be implemented by services. More...

#include <AnalysisService.hpp>

Public Member Functions

 AnalysisService (const std::string serviceID, const std::string requires, const std::string provides, const std::string queue)
 
virtual const
mico::rdf::model::URI
getServiceID () const
 Return a unique ID (URI) that identifies this service and its functionality. More...
 
virtual const std::string & getProvides () const
 Return the type of output produced by this service as symbolic identifier. More...
 
virtual const std::string & getRequires () const
 Return the type of input required by this service as symbolic identifier. More...
 
virtual const std::string & getQueueName () const
 Return the queue name that should be used by the messaging infrastructure for this service. More...
 
virtual void call (std::function< void(const mico::persistence::ContentItem &ci, const mico::rdf::model::URI &object)> resp, mico::persistence::ContentItem &ci, mico::rdf::model::URI &object)=0
 Call this service for the given content item and object. More...
 

Protected Attributes

mico::rdf::model::URI serviceID
 
std::string provides
 
std::string requires
 
std::string queue
 

Detailed Description

Interface to be implemented by services.

Consists of some informational methods as well as a callback which is called whenever a new event for this service has been received.

Author
Sebastian Schaffert (sscha.nosp@m.ffer.nosp@m.t@apa.nosp@m.che..nosp@m.org)

Member Function Documentation

virtual void mico::event::AnalysisService::call ( std::function< void(const mico::persistence::ContentItem &ci, const mico::rdf::model::URI &object)>  resp,
mico::persistence::ContentItem ci,
mico::rdf::model::URI object 
)
pure virtual

Call this service for the given content item and object.

This method is called by the event manager whenever a new analysis event for this service has been received in its queue. The API takes care of automatically resolving the content item in the persistence service.

Parameters
respa response object that can be used to send back notifications about new objects to the broker
cithe content item to analyse
objectthe URI of the object to analyse in the content item (a content part or a metadata URI)
virtual const std::string& mico::event::AnalysisService::getProvides ( ) const
inlinevirtual

Return the type of output produced by this service as symbolic identifier.

In the first version of the API, this is simply an arbitrary string (e.g. MIME type)

Returns
a symbolic identifier representing the output type of this service
virtual const std::string& mico::event::AnalysisService::getQueueName ( ) const
inlinevirtual

Return the queue name that should be used by the messaging infrastructure for this service.

If explicitly set, this can be used to allow several services listen to the same queue and effectively implement a round-robin load balancing.

The implementation can return null, in which case the event API will choose a random queue name.

Returns
a string identifying the queue name this service wants to use
virtual const std::string& mico::event::AnalysisService::getRequires ( ) const
inlinevirtual

Return the type of input required by this service as symbolic identifier.

In the first version of the API, this is simply an arbitrary string (e.g. MIME type)

Returns
a symbolic identifier representing the input type of this service
virtual const mico::rdf::model::URI& mico::event::AnalysisService::getServiceID ( ) const
inlinevirtual

Return a unique ID (URI) that identifies this service and its functionality.

Returns
a unique ID identifying this service globally

The documentation for this class was generated from the following file: