// WsClientGenericRepository.h #ifndef dial__WsClientGenericRepository_H #define dial__WsClientGenericRepository_H // Client for the DIAL repository service. Inherits from // GenericRepository and may be accessed with a connection // string of the form: // @WS:: // where the address of the server is :. #include "dataset_catalog/GenericRepository.h" #include "dial_ws/DialWsClient.h" namespace dial { class WsClientGenericRepository : public dset::GenericRepository { private: // data // WS client. DialWsClient m_client; // Repository type. std::string m_type; // Connection. std::string m_conn; public: // Constructors and destructor. // Constructor. // The URL is the address of the service. // The connection is the one to be used by the the service, *not* // the one used to find this client. // The flag usegsi indicates whether GSI is to be used. WsClientGenericRepository(std::string url, std::string type, std::string conn, bool usegsi =true); public: // GenericRepository members. // Validity. bool is_valid() const; // Return the error code. int error() const; // Return a string describing an error. std::string error_string(int ecode) const; // Return the repository type. std::string repository_type() const; // Insert a new element into repository. int insert(std::string id, std::string element) const; // Delete an element from repository. int remove(std::string id) const; // Is an element in the repository. bool has(std::string id) const; // Retrieve an element from repository. std::string get(std::string id) const; // Retrieve the time for an entry. time_t time(std::string id) const; // Retrieve a collection of elements. int mget(const IdList& sids, ElementList& eles) const; // Get the number of IDs in the repository. size_type size() const; // Get the number of IDs in the repository since. size_type size_since(time_t time) const; // Get all the IDs in the repository. IdList get_ids(size_type maxent) const; // Get all the IDs in the repository since. IdList get_ids_since(time_t time, size_type maxent) const; public: // Local members // Return the gsoap structure. soap* psoap() const; // Return the service URL. const char* curl() const; // Return the repository type. const char* type() const; // Return the connection string. const char* conn() const; // Terminate service. // Don't call this! void terminate_service() const; // Clean up soap after use. // For internal use. void clean_soap() const; }; } // end namespace dial #endif