MICO Platform
 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 extractorID, const std::string extractorModeID, const std::string extractorVersion, const std::string requires, const std::string provides)
 
virtual const
mico::persistence::model::URI
getServiceID () const final
 Return a unique ID (URI) that identifies this service and its functionality. More...
 
virtual const std::string & getExtractorID ()
 Return an ID (String) that identifies this extractor. More...
 
virtual const std::string & getExtractorModeID ()
 Return an ID (String) that identifies this extractor. More...
 
virtual const std::string & getExtractorVersion ()
 Returns the version of the extractor. 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 final
 Return the queue name that should be used by the messaging infrastructure for this service. More...
 
virtual void call (mico::event::AnalysisResponse &response, std::shared_ptr< mico::persistence::model::Item > item, std::vector< std::shared_ptr< mico::persistence::model::Resource >> resources, std::map< std::string, std::string > &params)=0
 Call this service for the given content item and object. More...
 

Protected Attributes

mico::persistence::model::URI serviceID
 
std::string queue
 
std::string extractorID
 
std::string extractorModeID
 
std::string extractorVersion
 
std::string provides
 
std::string requires
 

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 ( mico::event::AnalysisResponse response,
std::shared_ptr< mico::persistence::model::Item item,
std::vector< std::shared_ptr< mico::persistence::model::Resource >>  resources,
std::map< std::string, std::string > &  params 
)
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::getExtractorID ( )
inlinevirtual

Return an ID (String) that identifies this extractor.

Returns
an ID that identifies the general functionality of this extractor
virtual const std::string& mico::event::AnalysisService::getExtractorModeID ( )
inlinevirtual

Return an ID (String) that identifies this extractor.

Returns
an ID that identifies the specific mode in which the extractor is running
virtual const std::string& mico::event::AnalysisService::getExtractorVersion ( )
inlinevirtual

Returns the version of the extractor.

Returns
an ID that identifies the specific mode in which the extractor is running
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
inlinefinalvirtual

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::persistence::model::URI& mico::event::AnalysisService::getServiceID ( ) const
inlinefinalvirtual

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: