X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fldap%2FEngine.hpp;h=91c392e248428988d26a8bac9f28d209edbb9355;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=9c6ab19b5b3be5f4e9fa47b3086609a6109055db;hpb=39033fd99e58e994a5e98c1060dcc79e0d81f9c9;p=anna.git diff --git a/include/anna/ldap/Engine.hpp b/include/anna/ldap/Engine.hpp index 9c6ab19..91c392e 100644 --- a/include/anna/ldap/Engine.hpp +++ b/include/anna/ldap/Engine.hpp @@ -1,37 +1,9 @@ -// ANNA - Anna is Not Nothingness Anymore -// -// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo -// -// http://redmine.teslayout.com/projects/anna-suite -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: eduardo.ramos.testillano@gmail.com -// cisco.tierra@gmail.com +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // #ifndef anna_ldap_Engine_hpp @@ -65,9 +37,9 @@ class Session; private: anna::Recycler a_sessions; - anna::ldap::Session* allocateSession (const int category) throw () { return a_sessions.create (); } + anna::ldap::Session* allocateSession (const int category) { return a_sessions.create (); } - void releaseSession (anna::ldap::Session* session) throw () { + void releaseSession (anna::ldap::Session* session) { MySession* aux = static_cast (session); a_sessions.release (aux); } @@ -87,7 +59,7 @@ public: * Devuelve el valor del indicador de conexión automática. Por defecto este indicador será \em true. * \return el valor del indicador de conexión automática. */ - bool getAutoBind() const throw() { return a_autoBind; } + bool getAutoBind() const { return a_autoBind; } /** * Establece el indicador de conexión automática. En caso de no indicarse será \em true. @@ -97,7 +69,7 @@ public: * crearla sin conexión automática, cambiar el temporizador asociado e invocar al Bind invocando * implícitamente al método ldap::Session::bind. */ - void setAutoBind(const bool autoBind) throw() { a_autoBind = autoBind; } + void setAutoBind(const bool autoBind) { a_autoBind = autoBind; } /** Crea o reusa una sesión LDAP con los parámetros recibidos. @@ -125,7 +97,7 @@ public: realizado correctamente. */ Session* createSession(const char* url, const char* user, const char* password, const int category = 0) - throw(RuntimeException); + noexcept(false); /** Crea o reusa una sesión LDAP con los parámetros recibidos. @@ -154,7 +126,7 @@ public: realizado correctamente. */ Session* createSession(const char* url, const int id, const char* user, const char* password, const int category = 0) - throw(RuntimeException); + noexcept(false); /** Crea o reusa una sesión LDAP con los parámetros recibidos a un servidor que no requiera identificar @@ -177,7 +149,7 @@ public: correspondiente en el metodo Session::eventResponse confirmando que el ClassCode::Bind se ha realizado correctamente. */ - Session* createSession(const char* url, const int category = 0) throw(RuntimeException) { + Session* createSession(const char* url, const int category = 0) noexcept(false) { return createSession(url, NULL, NULL, category); } @@ -192,7 +164,7 @@ public: \warning Si no hay ninguna sesión identificada por la pareja (url, user) se devolvera una excepción. */ - Session* findSession(const char* url, const char* user, Exception::Mode::_v emode = Exception::Mode::Throw) throw(RuntimeException); + Session* findSession(const char* url, const char* user, Exception::Mode::_v emode = Exception::Mode::Throw) noexcept(false); /** Devuelve la instancia de la sesión identificada por la pareja (url, id) recibidos como parámetros. @@ -205,7 +177,7 @@ public: \warning Si no hay ninguna sesión identificada por la pareja (url, id) se devolvera una excepción. */ - Session* findSession(const char* url, const int id, Exception::Mode::_v emode = Exception::Mode::Throw) throw(RuntimeException); + Session* findSession(const char* url, const int id, Exception::Mode::_v emode = Exception::Mode::Throw) noexcept(false); /** Devuelve la instancia de la sesión identificada por la pareja (url, user="") recibidos como parámetros. @@ -217,7 +189,7 @@ public: \warning Si no hay ninguna sesión identificada por la pareja (url, user) se devolvera una excepción. */ - Session* findSession(const char* url, Exception::Mode::_v emode = Exception::Mode::Throw) throw(RuntimeException) { + Session* findSession(const char* url, Exception::Mode::_v emode = Exception::Mode::Throw) noexcept(false) { return findSession(url, (const char*) NULL, emode); } @@ -226,20 +198,20 @@ public: * fuera NULL esta operación no tendrá ningún efecto. * \param session Session LDAP a liberar. */ - void closeSession(Session* session) throw(RuntimeException); + void closeSession(Session* session) noexcept(false); /** Devuelve un documento XML con la informacion relevante sobre esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion relevante sobre esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve el nombre lógico de este anna::app::Component. \return El nombre lógico de este anna::app::Component. */ - static const char* getClassName() throw() { return "anna::ldap::Engine"; } + static const char* getClassName() { return "anna::ldap::Engine"; } /** * Establece el nivel de depuración de las operaciones del OpenLDAP. @@ -249,7 +221,7 @@ public: * \see http://www.openldap.org/doc/admin23/runningslapd.html para más niveles. * \see DebugLevel */ - static int setDebugLevel(const int level) throw(RuntimeException); + static int setDebugLevel(const int level) noexcept(false); protected: /** @@ -269,7 +241,7 @@ protected: \see anna::Recycler */ - virtual Session* allocateSession(const int category) throw() = 0; + virtual Session* allocateSession(const int category) = 0; /** Metodo invocado para liberar sesiónes. En caso de que nuestra aplicacion requiera varios tipos de @@ -277,7 +249,7 @@ protected: el tipo adecuado de sesión. \see anna::Recycler */ - virtual void releaseSession(Session*) throw() = 0; + virtual void releaseSession(Session*) = 0; private: typedef std::pair session_key; @@ -290,29 +262,29 @@ private: std::string a_auxURL; // Usada para contenar el ldap:// si fuera necesario bool a_autoBind; - void do_initialize() throw() {;} - void do_stop() throw(); + void do_initialize() {;} + void do_stop() ; - const char* completeURL(const char* url) throw(); + const char* completeURL(const char* url) ; - session_iterator session_find(const char* url, const char* user) throw() { + session_iterator session_find(const char* url, const char* user) { return a_sessions.find(session_key(url, user)); } - session_iterator session_find(const std::string& url, const std::string& user) throw() { + session_iterator session_find(const std::string& url, const std::string& user) { return a_sessions.find(session_key(url, user)); } - session_iterator session_find(const char* url, const int id) throw(); + session_iterator session_find(const char* url, const int id) ; - session_iterator session_begin() throw() { return a_sessions.begin(); } - session_iterator session_end() throw() { return a_sessions.end(); } - static Session* session(session_iterator ii) throw() { return ii->second; } + session_iterator session_begin() { return a_sessions.begin(); } + session_iterator session_end() { return a_sessions.end(); } + static Session* session(session_iterator ii) { return ii->second; } - const_session_iterator session_begin() const throw() { return a_sessions.begin(); } - const_session_iterator session_end() const throw() { return a_sessions.end(); } - static const Session* session(const_session_iterator ii) throw() { return ii->second; } + const_session_iterator session_begin() const { return a_sessions.begin(); } + const_session_iterator session_end() const { return a_sessions.end(); } + static const Session* session(const_session_iterator ii) { return ii->second; } // Para el truco de poner a la alarma antes de invocar al ldap_result - static void alarmnCatcher(int) throw(); + static void alarmnCatcher(int) ; };