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 #ifndef _OSBUSERMGR_I_H_
00034 #define _OSBUSERMGR_I_H_
00035
00036
00037
00038
00039 #include "tao/PortableServer/PortableServer.h"
00040
00041
00042 #include "corba_utility.h"
00043 #include "osbusermgrS.h"
00044 #include "servantlocators.h"
00045
00046
00047 namespace OSB_LIB {
00048 class OsbUser;
00049 }
00050
00051
00052
00053 namespace OSB_CORBA {
00054 using namespace corba::osbadm;
00055 using corba::common::Utf8String;
00056 using OSB_LIB::OsbUser;
00057
00061 class UserMgr_i : public virtual POA_corba::osbadm::UserMgr
00062 {
00064 typedef corba::osbadm::UserMgr::UserSeq UserSeq;
00066 typedef corba::osbadm::UserMgr::UserGroupSeq UserGroupSeq;
00067
00068 public:
00070 static const std::string IFC;
00071
00078 UserMgr_i(
00079 PortableServer::POA_ptr rootPoa,
00080 PortableServer::POAManager_ptr poaManager
00081 );
00082
00083 private:
00085 UserMgr_i(const UserMgr_i&);
00087 UserMgr_i& operator=(const UserMgr_i&);
00088
00089 public:
00091
00092
00100 User_ptr login(
00101 const Utf8String& loginName,
00102 const Utf8String& password
00103 ) throw (CORBA::SystemException, OsbCorbaException);
00104
00112 User_ptr getUser(const UserId& userId)
00113 throw (CORBA::SystemException, OsbCorbaException);
00114
00121 UserSeq* getUsers()
00122 throw (CORBA::SystemException, OsbCorbaException);
00123
00135 UserWriter_ptr createUser(
00136 const Utf8String& loginName,
00137 const Utf8String& password
00138 ) throw (CORBA::SystemException, OsbCorbaException);
00139
00149 CORBA::Boolean removeUser(
00150 const UserId& userId,
00151 CORBA::Boolean noWait
00152 ) throw (CORBA::SystemException, OsbCorbaException);
00154
00156
00157
00163 UserGroup* userGroup(
00164 const UserGroupId& grpId
00165 ) throw (CORBA::SystemException, OsbCorbaException);
00174 UserGroupSeq* userGroups(
00175 const ModuleId& modId
00176 ) throw (CORBA::SystemException);
00178 UserGroupSeq* allUserGroups()
00179 throw (CORBA::SystemException);
00181
00182 public:
00184 PortableServer::POA_ptr writerPoa() const {
00185 return writerPoa_.ptr();
00186 }
00187
00188 private:
00195 void createUserPoa(
00196 PortableServer::POA_ptr rootPoa,
00197 PortableServer::POAManager_ptr poaManager
00198 );
00199
00206 void createWriterPoa(
00207 PortableServer::POA_ptr rootPoa,
00208 PortableServer::POAManager_ptr poaManager
00209 );
00210
00212 User_ptr userServant(const OSB_LIB::OsbUser& user);
00213
00214 private:
00216 PortableServer::POA_var userPoa_;
00218 Locators userLoc_;
00219
00221 PortableServer::POA_var writerPoa_;
00222 };
00223 }
00224
00225
00226
00227
00228 #endif // #ifndef _OSBUSERMGR_I_H_