osbusermgr_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00009 /*
00010   AUTHOR(S): Elangovan Angannan (aen)
00011 
00012   RCS information
00013    $Name: OSB_060808 $
00014    $Revision: 1.10 $
00015 
00016   License
00017    OSB rating and billing library for communication networks
00018    Copyright (C) 2004, 2005, 2006  OSB systems
00019 
00020    This file may be distributed and/or modify under the terms of the
00021    GNU General Public License (GPL) as published by the Free Software
00022    Foundation which is provided in the file LICENSE.GPL included in the
00023    packaging of this file.
00024 
00025    The file is distributed in the hope that it will be useful, but WITHOUT
00026    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00027    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00028    for more details.
00029 
00030    Holders of a OSB Commercial License may use this file under the terms
00031    and conditions of this commercial license.
00032  */
00033 #ifndef _OSBUSERMGR_I_H_
00034 #define _OSBUSERMGR_I_H_
00035 
00036 // *********************************************************************
00037 // included header files
00038 // + standard includes
00039 #include "tao/PortableServer/PortableServer.h"
00040 
00041 // + local headers
00042 #include "corba_utility.h"
00043 #include "osbusermgrS.h"
00044 #include "servantlocators.h"
00045 
00046 // class declarations
00047 namespace OSB_LIB {
00048     class OsbUser;                      // osbuser.h
00049 }
00050 
00051 // *********************************************************************
00052 // namepace extensions
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:                             // utils
00184         PortableServer::POA_ptr writerPoa() const {
00185             return writerPoa_.ptr();
00186         }
00187 
00188     private:                            // Member functions.
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:                            // Attributes
00216         PortableServer::POA_var userPoa_;
00218         Locators userLoc_;
00219 
00221         PortableServer::POA_var writerPoa_;
00222     };                                  // class UserMgr_i
00223 }
00224 
00225 // *********************************************************************
00226 // inline definitions
00227 
00228 #endif                                  // #ifndef _OSBUSERMGR_I_H_

Generated on Sat Sep 2 14:25:52 2006 for OSB Library by  doxygen 1.4.7