*
* @section libraries Kea libraries
* - @subpage libcc
- * - @subpage libyang
* - @subpage libdhcp
* - @subpage libdhcpIntro
* - @subpage libdhcpRelay
* - @subpage libprocess
* - @subpage cpl
* - @subpage cplSignals
+ * - @subpage libyang
*
* @section miscellaneousTopics Miscellaneous Topics
* - @subpage terminology
SysrepoConnection::~SysrepoConnection() {
if (session_) {
- session_->discard_changes();
- session_->unlock_datastore();
- session_->session_stop();
+ session_->discard_changes();
+ session_->unlock_datastore();
+ session_->session_stop();
- // how to call disconnect?
+ // @todo: how to call disconnect?
}
}
void
SysrepoConnection::commit() {
- if (!session_) {
- isc_throw(SysrepoConnectionError, "session not established");
- }
- session_->commit();
+ if (!session_) {
+ isc_throw(SysrepoConnectionError, "session not established");
+ }
+ session_->commit();
}
}
namespace isc {
namespace yang {
+/// @brief Exception from the sysrepo library for connection.
class SysrepoConnectionError : public Exception {
public:
SysrepoConnectionError(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
};
+/// @brief Connection to the sysrepo library. Provision, i.e. currently unused.
class SysrepoConnection {
public:
+ // @brief Constructor.
SysrepoConnection();
+
+ // @brief Destructor.
virtual ~SysrepoConnection();
+
+ // @brief Get a connection and a session.
void connect();
+ // @brief Commit a session.
void commit();
private:
+ // @brief The session.
S_Session session_;
};