version 1.17, 2002/04/01 22:58:52
|
version 1.18, 2002/04/02 22:01:58
|
|
|
class ModuleController; | class ModuleController; |
| |
| |
class PEGASUS_COMMON_LINKAGE pegasus_module : pegasus_authorization_handle |
class PEGASUS_COMMON_LINKAGE pegasus_module |
{ | { |
private: | private: |
class module_rep |
class module_rep : public pegasus_auth_handle |
{ | { |
public: | public: |
|
typedef pegasus_auth_handle Base; |
|
|
module_rep(ModuleController *controller, | module_rep(ModuleController *controller, |
const String & name, | const String & name, |
void *module_address, | void *module_address, |
|
|
void _send_shutdown_notify(void); | void _send_shutdown_notify(void); |
void lock(void) { _thread_safety.lock(pegasus_thread_self()); } | void lock(void) { _thread_safety.lock(pegasus_thread_self()); } |
void unlock(void) { _thread_safety.unlock(); } | void unlock(void) { _thread_safety.unlock(); } |
|
|
|
Boolean authorized(void) ; |
|
Boolean authorized(Uint32); |
|
Boolean authorized(Uint32, Uint32); |
|
|
private: | private: |
module_rep(void); | module_rep(void); |
module_rep(const module_rep & ); | module_rep(const module_rep & ); |
|
|
}; | }; |
| |
public: | public: |
typedef pegasus_authorization_handle Base; |
|
|
|
pegasus_module(ModuleController *controller, | pegasus_module(ModuleController *controller, |
const String &id, | const String &id, |
void *module_address, | void *module_address, |
|
|
pegasus_module(const pegasus_module & mod); | pegasus_module(const pegasus_module & mod); |
pegasus_module & operator= (const pegasus_module & mod); | pegasus_module & operator= (const pegasus_module & mod); |
| |
~pegasus_module(void); |
virtual ~pegasus_module(void); |
| |
virtual Boolean authorized(pegasus_base_identity *id, Uint32 operation); |
virtual Boolean authorized(Uint32 operation); |
virtual Boolean authorized(pegasus_base_identity *id); |
virtual Boolean authorized(void); |
| |
Boolean operator == (const pegasus_module *mod) const; | Boolean operator == (const pegasus_module *mod) const; |
Boolean operator == (const pegasus_module & mod) const ; | Boolean operator == (const pegasus_module & mod) const ; |
|
|
| |
| |
private: | private: |
pegasus_base_identity *_id; |
|
module_rep *_rep; | module_rep *_rep; |
| |
pegasus_module(void); | pegasus_module(void); |
|
|
| |
| |
private: | private: |
class client_handle : pegasus_authorization_handle |
class client_handle : public pegasus_auth_handle |
{ | { |
public: | public: |
typedef pegasus_authorization_handle Base; |
typedef pegasus_auth_handle Base; |
| |
client_handle(void) |
client_handle(const pegasus_identity & id) |
:Base(), |
:Base(id) , |
_id(new pegasus_internal_identity(peg_credential_types::SERVICE)), |
|
allowed_operations( GET_CLIENT_HANDLE | | allowed_operations( GET_CLIENT_HANDLE | |
FIND_SERVICE | | FIND_SERVICE | |
FIND_MODULE_IN_SERVICE | | FIND_MODULE_IN_SERVICE | |
|
|
| |
} | } |
| |
client_handle(pegasus_base_identity *id) |
|
:Base(), _id(id) |
|
{ |
|
if( id && (id->get_base_id_type() == peg_identity_types::INTERNAL )) |
|
{ |
|
if (id->get_base_cred_type() == peg_credential_types::SERVICE ) |
|
allowed_operations = ModuleController::CLIENT_SEND_WAIT | |
|
ModuleController::CLIENT_SEND_WAIT_MODULE | |
|
ModuleController::CLIENT_SEND_ASYNC | |
|
ModuleController::CLIENT_SEND_ASYNC_MODULE | |
|
ModuleController::CLIENT_BLOCKING_THREAD_EXEC | |
|
ModuleController::CLIENT_ASYNC_THREAD_EXEC; |
|
else |
|
allowed_operations = 0; |
|
} |
|
|
|
} |
|
~client_handle(void) | ~client_handle(void) |
{ | { |
delete _id; |
|
} | } |
| |
|
virtual Boolean authorized(Uint32, Uint32); |
virtual Boolean authorized(Uint32 operation); | virtual Boolean authorized(Uint32 operation); |
virtual Boolean authorized(void); | virtual Boolean authorized(void); |
|
bitset<32> allowed_operations; |
| |
private: |
|
pegasus_base_identity *_id; |
|
bitset<64> allowed_operations; |
|
}; | }; |
| |
public: | public: |