MICO Platform  1.0.0
 All Classes Namespaces Functions Variables Friends
Public Member Functions | List of all members
mico::persistence::PersistenceService Class Reference

Main service for accessing the MICO persistence API. More...

#include <PersistenceService.hpp>

Public Member Functions

 PersistenceService (std::string serverAddress)
 Initialise persistence service with the address of a server running the standard installation of the MICO platform with Marmotta at port 8080 under context /marmotta, RabbitMQ at port 5672, and an FTP server, all with login/password mico/mico.
 
 PersistenceService (std::string serverAddress, int marmottaPort, std::string user, std::string password)
 Initialise persistence service with the address of a server running the standard installation of the MICO platform with Marmotta at port 8080 under context /marmotta, RabbitMQ at port 5672, and an FTP server, all with login/password mico/mico.
 
 PersistenceService (std::string marmottaServerUrl, std::string contentDirectory)
 Initialise an instance of the PersistenceService using the Marmotta server with the given URL as backend. More...
 
PersistenceMetadatagetMetadata ()
 Get a handle on the overall metadata storage of the persistence service. More...
 
ContentItemcreateContentItem ()
 Create a new content item with a random URI and return it. More...
 
ContentItemcreateContentItem (const mico::rdf::model::URI &id)
 Create a new content item with the given URI and return it. More...
 
ContentItemgetContentItem (const mico::rdf::model::URI &id)
 Return the content item with the given URI if it exists. More...
 
void deleteContentItem (const mico::rdf::model::URI &id)
 Delete the content item with the given URI. More...
 
content_item_iterator begin ()
 Return an iterator over all currently available content items. More...
 
content_item_iterator end ()
 Return the end iterator for checking when iteration has completed.
 

Detailed Description

Main service for accessing the MICO persistence API.

The persistence service can be used for managing ContentItems stored in the peristence API of the MICO platform. Services working with ContentItems should only use instances of this class for accessing the persistence API.

Constructor & Destructor Documentation

mico::persistence::PersistenceService::PersistenceService ( std::string  marmottaServerUrl,
std::string  contentDirectory 
)
inline

Initialise an instance of the PersistenceService using the Marmotta server with the given URL as backend.

Parameters
marmottaServerUrlthe URL of the Apache Marmotta server, e.g. http://localhost:8080/marmotta

Member Function Documentation

content_item_iterator mico::persistence::PersistenceService::begin ( )

Return an iterator over all currently available content items.

Returns
iterable
ContentItem * mico::persistence::PersistenceService::createContentItem ( )

Create a new content item with a random URI and return it.

The content item should be suitable for reading and updating and write all updates to the underlying low-level persistence layer.

Returns
a handle to the newly created ContentItem
ContentItem * mico::persistence::PersistenceService::createContentItem ( const mico::rdf::model::URI id)

Create a new content item with the given URI and return it.

The content item should be suitable for reading and updating and write all updates to the underlying low-level persistence layer.

Returns
a handle to the newly created ContentItem
void mico::persistence::PersistenceService::deleteContentItem ( const mico::rdf::model::URI id)

Delete the content item with the given URI.

If the content item does not exist, do nothing.

ContentItem * mico::persistence::PersistenceService::getContentItem ( const mico::rdf::model::URI id)

Return the content item with the given URI if it exists.

The content item should be suitable for reading and updating and write all updates to the underlying low-level persistence layer.

Returns
a handle to the ContentItem with the given URI, or null if it does not exist
PersistenceMetadata& mico::persistence::PersistenceService::getMetadata ( )
inline

Get a handle on the overall metadata storage of the persistence service.

This can e.g. be used for querying about existing content items.

Returns

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