#include <SL3_CredentialsCurator.h>
Inheritance diagram for TAO::SL3::CredentialsCurator:
Public Types | |
typedef CredentialsCurator_ptr | _ptr_type |
typedef CredentialsCurator_var | _var_type |
typedef CredentialsCurator_out | _out_type |
typedef ACE_Map_Manager< const char *, TAO::SL3::CredentialsAcquirerFactory *, ACE_Null_Mutex > | Acquirer_Factory_Table |
typedef Acquirer_Factory_Table::iterator | Factory_Iterator |
typedef ACE_Hash_Map_Manager_Ex< const char *, SecurityLevel3::OwnCredentials_var, ACE_Hash< const char * >, ACE_Equal_To< const char * >, ACE_Null_Mutex > | Credentials_Table |
typedef Credentials_Table::iterator | Credentials_Iterator |
Public Member Functions | |
CredentialsCurator (void) | |
Constructor. | |
void | register_acquirer_factory (const char *acquisition_method, TAO::SL3::CredentialsAcquirerFactory *factory) |
Register CredentialsAcquirer factory. | |
void | _tao_add_own_credentials (SecurityLevel3::OwnCredentials_ptr credentials) |
SecurityLevel3::CredentialsCurator Methods | |
Methods required by the SecurityLevel3::CredentialsCurator interface. | |
virtual SecurityLevel3::AcquisitionMethodList * | supported_methods () |
virtual SecurityLevel3::CredentialsAcquirer_ptr | acquire_credentials (const char *acquisition_method, const CORBA::Any &acquisition_arguments) |
virtual SecurityLevel3::OwnCredentialsList * | default_creds_list () |
virtual SecurityLevel3::CredentialsIdList * | default_creds_ids () |
virtual SecurityLevel3::OwnCredentials_ptr | get_own_credentials (const char *credentials_id) |
virtual void | release_own_credentials (const char *credentials_id) |
Static Public Member Functions | |
CredentialsCurator_ptr | _duplicate (CredentialsCurator_ptr obj) |
CredentialsCurator_ptr | _nil (void) |
CredentialsCurator_ptr | _narrow (CORBA::Object_ptr obj) |
Protected Member Functions | |
~CredentialsCurator (void) | |
Destructor. | |
Private Attributes | |
TAO_SYNCH_MUTEX | lock_ |
Lock used to synchronize access to underlying tables. | |
Acquirer_Factory_Table | acquirer_factories_ |
Table of CredentialsAcquirer factories. | |
Credentials_Table | credentials_table_ |
Table of OwnCredentials. |
This class provides a means for creating and managing OwnCredentials.
Definition at line 60 of file SL3_CredentialsCurator.h.
|
Reimplemented from CORBA::LocalObject. Definition at line 67 of file SL3_CredentialsCurator.h. |
|
Reimplemented from CORBA::LocalObject. Definition at line 65 of file SL3_CredentialsCurator.h. |
|
Reimplemented from CORBA::LocalObject. Definition at line 66 of file SL3_CredentialsCurator.h. |
|
The type of table that maps acquisition method to acquirer factory. Definition at line 75 of file SL3_CredentialsCurator.h. |
|
Definition at line 83 of file SL3_CredentialsCurator.h. Referenced by default_creds_ids(), default_creds_list(), and ~CredentialsCurator(). |
|
Definition at line 82 of file SL3_CredentialsCurator.h. |
|
Definition at line 76 of file SL3_CredentialsCurator.h. Referenced by supported_methods(), and ~CredentialsCurator(). |
|
Constructor.
Definition at line 21 of file SL3_CredentialsCurator.cpp.
00022 : lock_ (), 00023 acquirer_factories_ (), 00024 credentials_table_ (TAO::SL3::CREDENTIALS_TABLE_SIZE) 00025 { 00026 } |
|
|
Definition at line 56 of file SL3_CredentialsCurator.cpp. References TAO_Local_RefCounted_Object::_add_ref(), TAO::SL3::CredentialsCurator_ptr, and CORBA::is_nil(). Referenced by _narrow().
00057 { 00058 if (!CORBA::is_nil (obj)) 00059 obj->_add_ref (); 00060 00061 return obj; 00062 } |
|
Reimplemented from CORBA::LocalObject. Definition at line 65 of file SL3_CredentialsCurator.cpp. References _duplicate().
00066 { 00067 return TAO::SL3::CredentialsCurator::_duplicate ( 00068 dynamic_cast<TAO::SL3::CredentialsCurator *> (obj)); 00069 } |
|
Reimplemented from CORBA::LocalObject. Definition at line 72 of file SL3_CredentialsCurator.cpp.
00073 { 00074 return (CredentialsCurator *) 0; 00075 } |
|
TAO-specific means of adding credentials to this CredentialsCurator's "own credentials" list. Definition at line 249 of file SL3_CredentialsCurator.cpp. References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), and credentials_table_.
00251 { 00252 CORBA::String_var credentials_id = 00253 credentials->creds_id (); 00254 00255 SecurityLevel3::OwnCredentials_var creds = 00256 SecurityLevel3::OwnCredentials::_duplicate (credentials); 00257 00258 if (this->credentials_table_.bind (credentials_id.in (), 00259 creds) != 0) 00260 { 00261 throw CORBA::NO_RESOURCES (); 00262 } 00263 00264 // CredentialsCurator nows owns the id. 00265 (void) credentials_id._retn (); 00266 } |
|
Definition at line 107 of file SL3_CredentialsCurator.cpp. References acquirer_factories_, ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::find(), and TAO::SL3::CredentialsAcquirerFactory::make().
00110 { 00111 TAO::SL3::CredentialsAcquirerFactory * factory; 00112 00113 if (this->acquirer_factories_.find (acquisition_method, 00114 factory) == 0) 00115 { 00116 return factory->make (this, 00117 acquisition_arguments); 00118 } 00119 00120 throw CORBA::BAD_PARAM (); 00121 00122 } |
|
Definition at line 156 of file SL3_CredentialsCurator.cpp. References ACE_GUARD_RETURN, ACE_NEW_THROW_EX, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), Credentials_Iterator, credentials_table_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), CORBA::string_dup(), and TAO_SYNCH_MUTEX.
00157 { 00158 SecurityLevel3::CredentialsIdList * list; 00159 ACE_NEW_THROW_EX (list, 00160 SecurityLevel3::CredentialsIdList, 00161 CORBA::NO_MEMORY ()); 00162 SecurityLevel3::CredentialsIdList_var creds_ids = list; 00163 00164 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00165 guard, 00166 this->lock_, 00167 0); 00168 00169 creds_ids->length (this->credentials_table_.current_size ()); 00170 00171 CORBA::ULong n = 0; 00172 00173 const Credentials_Iterator end = this->credentials_table_.end (); 00174 for (Credentials_Iterator i = this->credentials_table_.begin (); 00175 i != end; 00176 ++i) 00177 { 00178 creds_ids[n++] = CORBA::string_dup ((*i).ext_id_); 00179 } 00180 00181 return creds_ids._retn (); 00182 } |
|
Definition at line 125 of file SL3_CredentialsCurator.cpp. References ACE_GUARD_RETURN, ACE_NEW_THROW_EX, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), Credentials_Iterator, credentials_table_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), and TAO_SYNCH_MUTEX.
00126 { 00127 SecurityLevel3::OwnCredentialsList * list; 00128 ACE_NEW_THROW_EX (list, 00129 SecurityLevel3::OwnCredentialsList, 00130 CORBA::NO_MEMORY ()); 00131 00132 SecurityLevel3::OwnCredentialsList_var creds_list = list; 00133 00134 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00135 guard, 00136 this->lock_, 00137 0); 00138 00139 creds_list->length (this->credentials_table_.current_size ()); 00140 00141 CORBA::ULong n = 0; 00142 00143 const Credentials_Iterator end = this->credentials_table_.end (); 00144 for (Credentials_Iterator i = this->credentials_table_.begin (); 00145 i != end; 00146 ++i) 00147 { 00148 creds_list[n++] = 00149 SecurityLevel3::OwnCredentials::_duplicate ((*i).int_id_.in()); 00150 } 00151 00152 return creds_list._retn (); 00153 } |
|
Definition at line 185 of file SL3_CredentialsCurator.cpp. References ACE_GUARD_RETURN, credentials_table_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), and TAO_SYNCH_MUTEX.
00187 { 00188 Credentials_Table::ENTRY * entry; 00189 00190 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00191 guard, 00192 this->lock_, 00193 SecurityLevel3::OwnCredentials::_nil ()); 00194 00195 if (this->credentials_table_.find (credentials_id, entry) != 0) 00196 { 00197 return SecurityLevel3::OwnCredentials::_nil (); 00198 } 00199 00200 return 00201 SecurityLevel3::OwnCredentials::_duplicate (entry->int_id_.in ()); 00202 } |
|
Register CredentialsAcquirer factory.
Definition at line 222 of file SL3_CredentialsCurator.cpp. References ACE_GUARD, acquirer_factories_, ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::bind(), CORBA::string_dup(), and TAO_SYNCH_MUTEX.
00225 { 00226 if (acquisition_method == 0 || factory == 0) 00227 throw CORBA::BAD_PARAM (); 00228 00229 CORBA::String_var method = CORBA::string_dup (acquisition_method); 00230 00231 ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_); 00232 00233 const int result = 00234 this->acquirer_factories_.bind (method.in (), factory); 00235 00236 if (result == 1) // Entry already exists in table. 00237 throw CORBA::BAD_INV_ORDER (); 00238 else if (result == -1) // Failure. 00239 throw CORBA::INTERNAL (); 00240 00241 00242 // CredentialsCurator now owns the acquisition method id. 00243 (void) method._retn (); 00244 00245 // Otherwise success! 00246 } |
|
Definition at line 205 of file SL3_CredentialsCurator.cpp. References ACE_GUARD, credentials_table_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), CORBA::string_free(), TAO_SYNCH_MUTEX, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind().
00207 { 00208 Credentials_Table::ENTRY * entry; 00209 00210 ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_); 00211 00212 if (this->credentials_table_.find (credentials_id, entry) == 0) 00213 { 00214 // Deallocate the external ID (a const char *) before unbinding. 00215 CORBA::string_free (const_cast<char *> (entry->ext_id_)); 00216 00217 (void) this->credentials_table_.unbind (entry); 00218 } 00219 } |
|
Definition at line 78 of file SL3_CredentialsCurator.cpp. References ACE_GUARD_RETURN, ACE_NEW_THROW_EX, acquirer_factories_, ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::begin(), ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::end(), Factory_Iterator, CORBA::string_dup(), and TAO_SYNCH_MUTEX.
00079 { 00080 SecurityLevel3::AcquisitionMethodList * list; 00081 ACE_NEW_THROW_EX (list, 00082 SecurityLevel3::AcquisitionMethodList, 00083 CORBA::NO_MEMORY ()); 00084 SecurityLevel3::AcquisitionMethodList_var methods = list; 00085 00086 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00087 guard, 00088 this->lock_, 00089 0); 00090 00091 methods->length (this->acquirer_factories_.current_size ()); 00092 00093 CORBA::ULong n = 0; 00094 00095 const Factory_Iterator end = this->acquirer_factories_.end (); 00096 for (Factory_Iterator i = this->acquirer_factories_.begin (); 00097 i != end; 00098 ++i) 00099 { 00100 methods[n++] = CORBA::string_dup ((*i).ext_id_); 00101 } 00102 00103 return methods._retn (); 00104 } |
|
Table of CredentialsAcquirer factories.
Definition at line 144 of file SL3_CredentialsCurator.h. Referenced by acquire_credentials(), register_acquirer_factory(), supported_methods(), and ~CredentialsCurator(). |
|
Table of OwnCredentials.
Definition at line 147 of file SL3_CredentialsCurator.h. Referenced by _tao_add_own_credentials(), default_creds_ids(), default_creds_list(), get_own_credentials(), release_own_credentials(), and ~CredentialsCurator(). |
|
Lock used to synchronize access to underlying tables.
Definition at line 141 of file SL3_CredentialsCurator.h. |