All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
server::SystemHandler Class Reference

Public Member Functions

 SystemHandler (const std::string &dataDir, const std::string &confDir)
 
void setDataDirectory (const std::string &datatDir)
 
void setConfDirectory (const std::string &confDir)
 
std::string initDatabase ()
 
std::string findNewDSS ()
 
void fillDssList (std::vector< std::string > &dssList)
 
bool empty ()
 
bool holdsDss (const std::string &dss)
 
bool holdsDataSet (const std::string &dssName, int sequenceNumber)
 
entity::DataSetSpecifiergetDss (const std::string &dssName)
 
void generateSequenceNumber (const std::string &dssName, entity::DataSet &dataSet)
 
void addDataSet (const std::string &dssName, entity::DataSet &dataSet)
 
std::string getStorePath (const std::string &dssName, const std::string &itemName, int sequenceNumber, entity::Group group, entity::Tag tag)
 
std::string getStorePath (const std::string &dssName, int sequenceNumber)
 
bool removeDataSet (const std::string &dssName, int sequenceNumber)
 
entity::DataSet getDataSet (const std::string &dssName, int sequenceNumber)
 
void search (const std::string &dssName, const std::map< std::string, std::string > &queryFields, std::vector< entity::SetDescriptor > &descriptorList)
 

Member Function Documentation

void SystemHandler::addDataSet ( const std::string &  dssName,
entity::DataSet dataSet 
)

Add a new DataSet to the system collection.

Parameters
dssNameThe name of a DSS.
dataSetThe DataSet instance provided by the client.
bool SystemHandler::empty ( )
Returns
true if the system has no DSS, false otherwise.
void SystemHandler::fillDssList ( std::vector< std::string > &  dssList)
Parameters
dssListString vector to store the current DSS names within the system.
string SystemHandler::findNewDSS ( )

Look for new configuration files added later in the system conf directory. For each new entry found a new DataSetSpecifier object is added to the system.

Returns
A string with the found DSS names or an empty string if no DSS was found.
DataSet SystemHandler::getDataSet ( const std::string &  dssName,
int  sequenceNumber 
)

Get a copy of the specified DataSet.

Parameters
dssNameThe DSS instantiated by the DataSet.
sequenceNumberThe sequence number of the specified DataSet.
Returns
The request DataSet object.
Exceptions
logic_errorif the specified DataSet has not been found.
std::string server::SystemHandler::getStorePath ( const std::string &  dssName,
const std::string &  itemName,
int  sequenceNumber,
entity::Group  group,
entity::Tag  tag 
)

Build the extended path of the specified DataItem.

Parameters
dssNameThe DSS of the DataItem.
itemNameThe DataItem name.
sequenceNumberThe Sequence Number of the DataSet where the DataItem belongs.
groupThe DataItem group.
tagThe DataItem tag.
Returns
The extended path of the DataItem, built according to specified arguments.
std::string server::SystemHandler::getStorePath ( const std::string &  dssName,
int  sequenceNumber 
)

Build the path of the DataSet with the number <sequenceNumber> of the <dssName> DSS.

Parameters
dssNameThe DSS instantiated by the DataSet.
sequenceNumberThe sequence number of the specified DataSet.
Returns
Extended path of the specified DataSet.
bool SystemHandler::holdsDataSet ( const std::string &  dssName,
int  sequenceNumber 
)
Parameters
dssNameA DSS name.
sequenceNumberThe sequence number of a DataSet instance of the given DSS.
Returns
true if the specified DataSet exists in the system, false otherwise.
bool SystemHandler::holdsDss ( const std::string &  dss)
Parameters
dssA DSS name.
Returns
true if the given DSS exists in the system, false otherwise.
string SystemHandler::initDatabase ( )

Initalize the system database looking for configuration files to be parsed into DataSetSpecifier objects.

Returns
A string with the found DSS names.
bool SystemHandler::removeDataSet ( const std::string &  dssName,
int  sequenceNumber 
)

Remove the specified DataSet and update the DSS SD-Index file.

Parameters
dssNameThe DSS instantiated by the DataSet.
sequenceNumberThe sequence number of the specified DataSet.
Returns
true if the operation succeeds, false otherwise.
void SystemHandler::search ( const std::string &  dssName,
const std::map< std::string, std::string > &  queryFields,
std::vector< entity::SetDescriptor > &  descriptorList 
)

Execute a search operation on the system data.

Parameters
dssNameThe name of a DSS.
queryFieldsThe SetDescriptor fields specified as query fields.
descriptorListSetDescriptors vector to be stored with the matching SetDescriptors (if any).
void SystemHandler::setConfDirectory ( const std::string &  confDir)
Parameters
confDirThe directory with the configuration file.
void SystemHandler::setDataDirectory ( const std::string &  datatDir)
Parameters
dataDirThe directry for the files storage.

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