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 HDFS 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 HDFS 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... | |
std::shared_ptr< model::Item > | createItem () |
Create a new content item with a random URI and return it. More... | |
std::shared_ptr< model::Item > | getItem (const mico::persistence::model::URI &id) |
Return the item with the given URI if it exists. More... | |
void | deleteItem (const mico::persistence::model::URI &id) |
Delete the content item with the given URI. More... | |
std::vector< std::shared_ptr < model::Item > > | getItems () |
Get all items of the persistence service connection Notice that this implementation might be rather slow since it fetches all items first and then creates new ItemMMM object out of it. More... | |
jnipp::LocalRef < jnipp::com::github::anno4j::Anno4j > | getAnno4j () |
Return an iterator over all currently available content items. More... | |
std::string | getStoragePrefix () |
std::string | getContentDirectory () |
std::string | unmaskContentLocation (const std::string &maskedURL) |
void | checkJavaExceptionThrow () |
void | checkJavaExceptionThrow (std::vector< std::string > exceptionNames) |
bool | checkJavaExceptionNoThrow (std::string &msg) |
bool | checkJavaExceptionNoThrow (std::vector< std::string > exceptionNames, std::string &msg) |
Static Public Member Functions | |
static JavaVM * | getJVM () |
Static Public Attributes | |
static JavaVM * | m_sJvm = nullptr |
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.
mico::persistence::PersistenceService::PersistenceService | ( | std::string | marmottaServerUrl, |
std::string | contentDirectory | ||
) |
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 |
std::shared_ptr< model::Item > mico::persistence::PersistenceService::createItem | ( | ) |
Create a new content item with a random URI and return it.
Create a new 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.
The item should be suitable for reading and updating and write all updates to the underlying low-level persistence layer.
void mico::persistence::PersistenceService::deleteItem | ( | const mico::persistence::model::URI & | id | ) |
Delete the content item with the given URI.
If the content item does not exist, do nothing.
jnipp::LocalRef< Anno4j > mico::persistence::PersistenceService::getAnno4j | ( | ) |
Return an iterator over all currently available content items.
std::shared_ptr< model::Item > mico::persistence::PersistenceService::getItem | ( | const mico::persistence::model::URI & | id | ) |
Return the item with the given URI if it exists.
The item should be suitable for reading and updating and write all updates to the underlying low-level persistence layer.
std::vector< std::shared_ptr< model::Item > > mico::persistence::PersistenceService::getItems | ( | ) |
Get all items of the persistence service connection Notice that this implementation might be rather slow since it fetches all items first and then creates new ItemMMM object out of it.
|
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.