Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ReplicaManagerExceptions.h

Go to the documentation of this file.
00001 /* -*- C++ -*-
00002  *
00003  * ReplicaManagerExceptions.h
00004  *
00005  * Copyright (c) 2002 CERN on behalf of the EU DataGrid.
00006  * For license conditions see LICENSE file or 
00007  * http://www.edg.org/license.html
00008  * 
00009  */
00010 
00011 #include <exception>
00012 #include <string>
00013 
00014 #ifndef ReplicaManagerExceptions_H
00015 #define ReplicaManagerExceptions_H 1
00016 
00017 /*
00018  *
00019  * @author <a href="mailto:james.casey@cern.ch">James Casey</a>
00020  * @author <a href="mailto:Radovan.Chytracek@cern.ch">Radovan Chytracek</a>
00021  * @author <a href="mailto:Peter.Kunszt@cern.ch">Peter Kunszt</a>
00022  * @version $Id: ReplicaManagerExceptions.h,v 1.7 2004/06/14 12:01:17 jamesc Exp $
00023  */
00024 namespace EdgReplicaManager {
00025 
00030   class ReplicaManagerException : public std::exception {
00031     public:
00032 
00033     public:
00034       ReplicaManagerException() throw() { }
00035 
00036       ReplicaManagerException(const std::string& what) throw() 
00037        : m_what ("Replica Manager C++ API: "+what) { }
00038 
00039       virtual ~ReplicaManagerException() throw(){ }
00040 
00041       virtual const char* what () const throw() {
00042         return m_what.c_str ();
00043       }
00044 
00045     private:
00046       std::string m_what;
00047   };
00048 
00052   class InfoServiceException : public ReplicaManagerException {
00053     public: 
00054       InfoServiceException(const std::string& msg) 
00055           : ReplicaManagerException("InfoService: " + msg) { }
00056 
00057       virtual ~InfoServiceException() throw(){ }
00058 
00059   };
00060 
00064   class LDAPException : public InfoServiceException {
00065     public: 
00066       LDAPException(const std::string& msg) 
00067           : InfoServiceException("LDAP-" + msg) { }
00068 
00069       virtual ~LDAPException() throw(){ }
00070 
00071   };
00072 
00076   class URIException : public ReplicaManagerException {
00077     public: 
00078       URIException(const std::string& msg) 
00079           : ReplicaManagerException(msg) { }
00080 
00081       virtual ~URIException() throw(){ }
00082 
00083   };
00084 
00088   class NotImplementedException : public ReplicaManagerException {
00089     public: 
00090       NotImplementedException(const std::string& method) 
00091           : ReplicaManagerException("Not Implemented: " + method),
00092             m_method(method) { }
00093 
00094       virtual ~NotImplementedException() throw(){ }
00095 
00096       const std::string& getMethod() const {
00097         return m_method;
00098       }
00099       
00100     private:
00101       const std::string m_method;
00102   };
00103 
00104 }
00105 
00106 
00107 #endif // ReplicaManagerExceptions_H
00108 
The EU DataGrid Project. All rights reserved.