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

  1 martin 1.12 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.13 //
  3 martin 1.12 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.13 //
 10 martin 1.12 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.13 //
 17 martin 1.12 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.13 //
 20 martin 1.12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.13 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.12 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.13 //
 28 martin 1.12 //////////////////////////////////////////////////////////////////////////
 29 mike   1.2  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             
 33             ////////////////////////////////////////////////////////////////////////////////
 34             //  This file contains the exception classes used in the UserManager
 35             //  classes.
 36             ////////////////////////////////////////////////////////////////////////////////
 37             
 38             #ifndef Pegasus_UserExceptions_h
 39             #define Pegasus_UserExceptions_h
 40             
 41             #include <Pegasus/Common/Exception.h>
 42             #include <Pegasus/Security/UserManager/Linkage.h>
 43 kumpf  1.11 #include <Pegasus/Common/MessageLoader.h>
 44 mike   1.2  
 45             PEGASUS_NAMESPACE_BEGIN
 46             
 47 kumpf  1.11 /**
 48                 DuplicateUser Exception class
 49 mike   1.2  */
 50             class PEGASUS_USERMANAGER_LINKAGE DuplicateUser : public Exception
 51             {
 52             public:
 53                 DuplicateUser(const String& userName)
 54 kumpf  1.11         : Exception(MessageLoaderParms(
 55                           "Security.UserManager.UserExceptions.USER_ALREADY_EXISTS",
 56                           "User already exists, user name: $0",
 57                           userName))
 58                 {
 59                 }
 60 mike   1.2  };
 61             
 62 kumpf  1.11 /**
 63                 InvalidUser Exception class
 64 mike   1.2  */
 65             class PEGASUS_USERMANAGER_LINKAGE InvalidUser : public Exception
 66             {
 67             public:
 68 kumpf  1.11     InvalidUser(const String& userName)
 69                     : Exception(MessageLoaderParms(
 70                           "Security.UserManager.UserExceptions.INVALID_CIM_USER",
 71                           "The specified user is not a valid CIM user, user name: $0.",
 72                           userName))
 73                 {
 74                 }
 75 mike   1.2  };
 76             
 77 kumpf  1.11 /**
 78                 InvalidSystemUser Exception class
 79 mike   1.2  */
 80             class PEGASUS_USERMANAGER_LINKAGE InvalidSystemUser : public Exception
 81             {
 82             public:
 83                 InvalidSystemUser(const String& userName)
 84 kumpf  1.11         : Exception(MessageLoaderParms(
 85                           "Security.UserManager.UserExceptions."
 86                               "INVALID_USER_ON_LOCAL_SYSTEM",
 87                           "The specified user is not a valid user on the local system, "
 88                               "user name: $0",
 89                           userName))
 90                 {
 91                 }
 92 mike   1.2  };
 93             
 94 kumpf  1.11 /**
 95                 PasswordMismatch Exception class
 96 mike   1.2  */
 97             class PEGASUS_USERMANAGER_LINKAGE PasswordMismatch : public Exception
 98             {
 99             public:
100                 PasswordMismatch(const String& userName)
101 kumpf  1.11         : Exception(MessageLoaderParms(
102                           "Security.UserManager.UserExceptions.PASSWORD_MISMATCH",
103                           "The specified password does not match user's current password, "
104                               "user name: $0",
105                           userName))
106                 {
107                 }
108 mike   1.2  };
109             
110 kumpf  1.11 /**
111                 PasswordCacheError Exception class
112 mike   1.2  */
113             class PEGASUS_USERMANAGER_LINKAGE PasswordCacheError : public Exception
114             {
115             public:
116                 PasswordCacheError()
117 kumpf  1.11         : Exception(MessageLoaderParms(
118                           "Security.UserManager.UserExceptions.INTERNAL_ERROR_PWD_CACHE",
119                           "Internal error while processing password cache table."))
120                 {
121                 }
122 mike   1.2  };
123             
124             /**
125 kumpf  1.11     InvalidUserAndNamespace Exception class
126 mike   1.2  */
127             class PEGASUS_USERMANAGER_LINKAGE InvalidUserAndNamespace : public Exception
128             {
129             public:
130 kumpf  1.11     InvalidUserAndNamespace(
131                     const String& userName,
132                     const String& nameSpace)
133                     : Exception(MessageLoaderParms(
134                           "Security.UserManager.UserExceptions."
135                               "USER_NAMESPACE_NOT_AUTHORIZED",
136                           "The specified user '$0' and namespace '$1' are not authorized.",
137                           userName,
138                           nameSpace))
139                 {
140                 }
141 mike   1.2  };
142             
143             /**
144 kumpf  1.11     AuthorizationCacheError Exception class
145 mike   1.2  */
146             class PEGASUS_USERMANAGER_LINKAGE AuthorizationCacheError : public Exception
147             {
148             public:
149                 AuthorizationCacheError()
150 kumpf  1.11         : Exception(MessageLoaderParms(
151                           "Security.UserManager.UserExceptions.INTERNAL_ERROR_AUTH_CACHE",
152                           "Internal error while processing authorization cache table."))
153                 {
154                 }
155 mike   1.2  };
156             
157             /**
158 kumpf  1.11     AuthorizationEntryNotFound Exception class
159 mike   1.2  */
160             class PEGASUS_USERMANAGER_LINKAGE AuthorizationEntryNotFound : public Exception
161             {
162             public:
163 kumpf  1.11     AuthorizationEntryNotFound(
164                     const String& userName,
165                     const String& nameSpace)
166                     : Exception(MessageLoaderParms(
167                           "Security.UserManager.UserExceptions.AUTH_ENTRY_NOT_FOUND",
168                           "Authorization entry not found for user '$0' with the namespace "
169                               "'$1'.",
170                           userName,
171                           nameSpace))
172                 {
173                 }
174 mike   1.2  };
175             
176             /**
177 kumpf  1.11     InvalidNamespace Exception class
178 mike   1.2  */
179             class PEGASUS_USERMANAGER_LINKAGE InvalidNamespace : public Exception
180             {
181             public:
182                 InvalidNamespace(String nameSpace)
183 kumpf  1.11         : Exception(MessageLoaderParms(
184                           "Security.UserManager.UserExceptions.NAMESPACE_DOES_NOT_EXIST",
185                           "The specified namespace does not exist, $0",
186                           nameSpace))
187                 {
188                 }
189 mike   1.2  };
190             
191 kumpf  1.4  /**
192 kumpf  1.11     CannotCreateUserManagerInstance Exception class
193 kumpf  1.4  */
194 kumpf  1.11 class PEGASUS_USERMANAGER_LINKAGE CannotCreateUserManagerInstance
195                 : public Exception
196 kumpf  1.4  {
197             public:
198                 CannotCreateUserManagerInstance()
199 kumpf  1.11         : Exception(MessageLoaderParms(
200                           "Security.UserManager.UserExceptions."
201                               "CANT_CREATE_USERMANAGER_INSTANCE",
202                           "Cannot create UserManager instance, repository handle passed "
203                               "may be invalid."))
204                 {
205                 }
206 kumpf  1.4  };
207             
208 mike   1.2  PEGASUS_NAMESPACE_END
209             
210             #endif /* Pegasus_UserExceptions_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2