// WsClientGenericSelectionCatalog.h.h #ifndef dial__WsClientGenericSelectionCatalog_H #define dial__WsClientGenericSelectionCatalog_H // Client for the DIAL selection catalog service. Inherits from // GenericSelectionCatalog and may be accessed with a connection // string of the form: // @WS:: // where the address of the server is :. #include "dataset_catalog/GenericSelectionCatalog.h" #include "dial_ws/DialWsClient.h" namespace dial { class WsClientGenericSelectionCatalog : public dset::GenericSelectionCatalog { private: // data // WS client. DialWsClient m_client; // SelectionCatalog.h 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. WsClientGenericSelectionCatalog( std::string url, std::string type, std::string conn, bool usegsi =true ); public: // Non-const methods. // Return the error code. bool is_valid() const; // Return the catalog type. Name catalog_type() const; // Return the unique ID encoding. Name id_encoding() const; // Retrieve the schema, i.e. the list of attribute names. NameList schema() const; // Is a name present? bool has_name(Name name) const; // Retrieve the attributes for an entry. Attributes attributes(Name name) const; // Return the ID associated with a name. Id id(Name name) const; // Return the number of entries. size_type size() const; // Get names for the first maxent entries returned by a query. NameList query(dset::SqlQuery sql, size_type maxent) const; // Retrieve the number of entries matching a query. size_type query_count(dset::SqlQuery sql) const; public: // Non-const methods. // Insert a new entry for the given name. int insert(Name name, const Attributes& att); // Update an existing entry in the catalog. int update(Name name, const Attributes& att); // Remove an entry. int remove(Name name); public: // Local members // Return the gsoap structure. soap* psoap() const; // Return the service URL. const char* curl() const; // Return the catalog 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