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... | |
PersistenceMetadata & | getMetadata () |
Get a handle on the overall metadata storage of the persistence service. More... | |
ContentItem * | createContentItem () |
Create a new content item with a random URI and return it. More... | |
ContentItem * | createContentItem (const mico::rdf::model::URI &id) |
Create a new content item with the given URI and return it. More... | |
ContentItem * | getContentItem (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. | |
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.
|
inline |
Initialise an instance of the PersistenceService using the Marmotta server with the given URL as backend.
marmottaServerUrl | the URL of the Apache Marmotta server, e.g. http://localhost:8080/marmotta |
content_item_iterator mico::persistence::PersistenceService::begin | ( | ) |
Return an iterator over all currently available content items.
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.
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.
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.
|
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.