00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _OSBUSER_I_H_
00035 #define _OSBUSER_I_H_
00036
00037
00038
00039
00040
00041
00042 #include "osbuser.h"
00043 #include "mutex.h"
00044
00045
00046 #include "osbuserS.h"
00047 #include "corba_utility.h"
00048
00049
00050
00051
00052
00053 namespace OSB_CORBA {
00054
00055 using namespace corba::osbadm;
00056
00057
00058
00059 class UserMgr_i;
00060
00064 class User_i : public virtual POA_corba::osbadm::User {
00066 friend class UserMgr_i;
00067 public:
00068 static const std::string IFC;
00069
00076 User_i(
00077 const UserMgr_i& usrMgr,
00078 const Utf8String& login
00079 );
00080
00087 User_i(
00088 const UserMgr_i& usrMgr,
00089 const OSB_LIB::OsbUser& osbUser
00090 );
00091
00092 public:
00099 UserId id()
00100 throw (CORBA::SystemException, OsbCorbaException);
00101
00107 Utf8String* loginName()
00108 throw (CORBA::SystemException, OsbCorbaException);
00109
00118 Utf8String* name()
00119 throw (CORBA::SystemException, OsbCorbaException);
00120
00122 Utf8String* email()
00123 throw (CORBA::SystemException, OsbCorbaException);
00124
00126
00127
00128 ModuleId defModule()
00129 throw (CORBA::SystemException, OsbCorbaException);
00130
00132 ModuleIdSeq* availModules()
00133 throw (CORBA::SystemException, OsbCorbaException);
00134
00136 CORBA::Boolean isAvailable(const ModuleId& id)
00137 throw (CORBA::SystemException, OsbCorbaException);
00138
00147 UserGroupId userGroup(
00148 const ModuleId& modId
00149 ) throw (CORBA::SystemException, OsbCorbaException);
00151
00157 UserWriter_ptr getWriter()
00158 throw (CORBA::SystemException, OsbCorbaException);
00159
00160 private:
00168 bool reassign(const OSB_LIB::OsbUser& osbUser);
00169
00170 protected:
00178 OSB_LIB::RwGuard readLock();
00186 OSB_LIB::RwGuard writeLock();
00187 protected:
00189 const UserMgr_i& usrMgr_;
00191 OSB_LIB::OsbUser osbUser_;
00193 OSB_LIB::RwMutex mutex_;
00194 };
00195
00199 class UserWriter_i :
00200 public virtual User_i,
00201 public virtual POA_corba::osbadm::UserWriter
00202 {
00203 public:
00205 static const std::string IFC;
00206
00213 UserWriter_i(
00214 const UserMgr_i& usrMgr,
00215 const OSB_LIB::OsbUser& osbUser
00216 );
00217
00225 void changePassword(
00226 const Utf8String& oldPw,
00227 const Utf8String& newPw
00228 ) throw (CORBA::SystemException, OsbCorbaException);
00229
00235 void resetPassword(
00236 const Utf8String& newPw
00237 ) throw (CORBA::SystemException, OsbCorbaException);
00238
00244 void setName(const Utf8String& name)
00245 throw (CORBA::SystemException, OsbCorbaException);
00246
00252 void setEmail(const Utf8String& email)
00253 throw (CORBA::SystemException, OsbCorbaException);
00254
00264 void setGrants(
00265 const UserGroupIdSeq& grps
00266 ) throw (CORBA::SystemException, OsbCorbaException);
00267
00277 CORBA::Boolean setDefModule(const ModuleId& defMod)
00278 throw (CORBA::SystemException, OsbCorbaException);
00287 void revoke(const ModuleId& modId)
00288 throw (CORBA::SystemException, OsbCorbaException);
00289
00300 void commitChanges(CORBA::Boolean noWait)
00301 throw (CORBA::SystemException, OsbCorbaException);
00302 };
00303 }
00304
00305 #endif // ifndef _OSBUSER_I_H_