osbuser_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00009 /*
00010   AUTHOR(S): Elangovan Angannan (aen)
00011              Stephan Broennimann (vb)
00012 
00013   RCS information
00014    $Name: OSB_060808 $
00015    $Revision: 1.16 $
00016 
00017   License
00018    OSB rating and billing library for communication networks
00019    Copyright (C) 2004, 2005, 2006  OSB systems
00020 
00021    This file may be distributed and/or modify under the terms of the
00022    GNU General Public License (GPL) as published by the Free Software
00023    Foundation which is provided in the file LICENSE.GPL included in the
00024    packaging of this file.
00025 
00026    The file is distributed in the hope that it will be useful, but WITHOUT
00027    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00028    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00029    for more details.
00030 
00031    Holders of a OSB Commercial License may use this file under the terms
00032    and conditions of this commercial license.
00033  */
00034 #ifndef _OSBUSER_I_H_
00035 #define _OSBUSER_I_H_
00036 
00037 // *********************************************************************
00038 // included header files
00039 // + standard includes
00040 
00041 // + libraries
00042 #include "osbuser.h"
00043 #include "mutex.h"
00044 
00045 // + local headers
00046 #include "osbuserS.h"
00047 #include "corba_utility.h"
00048 
00049 // class declarations
00050 
00051 // *********************************************************************
00052 // namespace extensions
00053 namespace OSB_CORBA {
00054 
00055     using namespace corba::osbadm;
00056 
00057 // *********************************************************************
00058 // forward declarations
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     };                                  // class User_i
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     };                                  // class UserWriter_i
00303 }
00304 
00305 #endif                                 // ifndef _OSBUSER_I_H_

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