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 |
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.
|
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.
resp | a response object that can be used to send back notifications about new objects to the broker |
ci | the content item to analyse |
object | the URI of the object to analyse in the content item (a content part or a metadata URI) |
|
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)
|
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.
|
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)
|
inlinevirtual |
Return a unique ID (URI) that identifies this service and its functionality.