(file) Return to UserExceptions.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Security / UserManager

  1 kumpf 1.1.2.1 //%/////////////////////////////////////////////////////////////////////////////
  2               //
  3               // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
  4               // The Open Group, Tivoli Systems
  5               //
  6               // Permission is hereby granted, free of charge, to any person obtaining a copy
  7               // of this software and associated documentation files (the "Software"), to
  8               // deal in the Software without restriction, including without limitation the
  9               // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10               // sell copies of the Software, and to permit persons to whom the Software is
 11               // furnished to do so, subject to the following conditions:
 12               //
 13               // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14               // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15               // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16               // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17               // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18               // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19               // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20               // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21               //
 22 kumpf 1.1.2.1 //==============================================================================
 23               //
 24               // Author: Sushma Fernandes, Hewlett Packard Company (sushma_fernandes@hp.com)
 25               //
 26               // Modified By:
 27               //
 28               //%/////////////////////////////////////////////////////////////////////////////
 29               
 30               
 31               ////////////////////////////////////////////////////////////////////////////////
 32               //  This file contains the exception classes used in the UserManager
 33               //  classes.
 34               ////////////////////////////////////////////////////////////////////////////////
 35               
 36               #ifndef Pegasus_UserExceptions_h
 37               #define Pegasus_UserExceptions_h
 38               
 39               #include <Pegasus/Common/Exception.h>
 40               #include <Pegasus/Security/UserManager/Linkage.h>
 41               
 42               PEGASUS_NAMESPACE_BEGIN
 43 kumpf 1.1.2.1 
 44               
 45               /** 
 46               DuplicateUser Exception class 
 47               */
 48               class PEGASUS_USERMANAGER_LINKAGE DuplicateUser : public Exception
 49               {
 50               public:
 51                   DuplicateUser(const String& userName)
 52                       : Exception("User already exists, user name: " + userName) { }
 53               };
 54               
 55               
 56               /** 
 57               InvalidUser Exception class 
 58               */
 59               class PEGASUS_USERMANAGER_LINKAGE InvalidUser : public Exception
 60               {
 61               public:
 62                   InvalidUser(const String& userName)
 63                       : Exception("The specified user is not a valid CIM user, user name: " 
 64 kumpf 1.1.2.1 		     + userName + ".") { } 
 65               };
 66               
 67               
 68               /** 
 69               InvalidSystemUser Exception class 
 70               */
 71               class PEGASUS_USERMANAGER_LINKAGE InvalidSystemUser : public Exception
 72               {
 73               public:
 74                   InvalidSystemUser(const String& userName)
 75                       : Exception("The specified user is not a valid user on the local system , user name: " + userName ) { }
 76               };
 77               
 78               /** 
 79               PasswordMismatch Exception class 
 80               */
 81               class PEGASUS_USERMANAGER_LINKAGE PasswordMismatch : public Exception
 82               {
 83               public:
 84                   PasswordMismatch(const String& userName)
 85 kumpf 1.1.2.1         : Exception("The specified password does not match user's current password, user name: " + userName ) { }
 86               };
 87               
 88               /** 
 89               PasswordFileSyntaxError Exception class 
 90               */
 91               class PEGASUS_USERMANAGER_LINKAGE PasswordFileSyntaxError : public Exception
 92               {
 93               public:
 94                   PasswordFileSyntaxError(const String& file, Uint32 line)
 95                       : Exception(_formatMessage(file, line)) { }
 96               
 97                   static String _formatMessage(const String& file, Uint32 line);
 98               };
 99               
100               /** 
101               PasswordCacheError Exception class 
102               */
103               class PEGASUS_USERMANAGER_LINKAGE PasswordCacheError : public Exception
104               {
105               public:
106 kumpf 1.1.2.1     PasswordCacheError()
107                       : Exception("Internal error while processing password cache table." ) { }
108               };
109               
110               /**
111               InvalidUserAndNamespace Exception class
112               */
113               class PEGASUS_USERMANAGER_LINKAGE InvalidUserAndNamespace : public Exception
114               {
115               public:
116                   InvalidUserAndNamespace(const String& userName, const String& nameSpace)
117                       : Exception("The specified user '" + userName + "' and namespace '"
118                           + nameSpace + "' are not authorized.") { }
119               };
120               
121               /**
122               AuthorizationCacheError Exception class
123               */
124               class PEGASUS_USERMANAGER_LINKAGE AuthorizationCacheError : public Exception
125               {
126               public:
127 kumpf 1.1.2.1     AuthorizationCacheError()
128                       : Exception("Internal error while processing authorization cache table." ) { }
129               };
130               
131               /**
132               AuthorizationEntryNotFound Exception class
133               */
134               class PEGASUS_USERMANAGER_LINKAGE AuthorizationEntryNotFound : public Exception
135               {
136               public:
137                   AuthorizationEntryNotFound(const String& userName, const String& nameSpace)
138                       : Exception("Authorization entry not found for user '" +
139                           userName + "' with the namespace '" + nameSpace + "'." ) { }
140               };
141               
142               /**
143               InvalidNamespace Exception class
144               */
145               class PEGASUS_USERMANAGER_LINKAGE InvalidNamespace : public Exception
146               {
147               public:
148 kumpf 1.1.2.1     InvalidNamespace(String nameSpace)
149                       : Exception("The specified namespace does not exist, " + nameSpace ) { }
150               
151               };
152               
153               PEGASUS_NAMESPACE_END
154               
155               #endif /* Pegasus_UserExceptions_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2