#include "orbsvcs/Security/SL3_PolicyFactory.h"
#include "orbsvcs/Security/SL3_ContextEstablishmentPolicy.h"
#include "orbsvcs/Security/SL3_ObjectCredentialsPolicy.h"
Include dependency graph for SL3_PolicyFactory.cpp:
Go to the source code of this file.
Functions | |
ACE_RCSID (Security, SL3_PolicyFactory,"$Id:SL3_PolicyFactory.cpp 77406 2007-02-26 23:37:11Z ossama $") TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA |
|
Definition at line 8 of file SL3_PolicyFactory.cpp. References ACE_NEW_THROW_EX, CORBA::Policy_ptr, and TAO_BEGIN_VERSIONED_NAMESPACE_DECL.
00010 : SL3_PolicyFactory.cpp 77406 2007-02-26 23:37:11Z ossama $") 00011 00012 00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 CORBA::Policy_ptr 00016 TAO::SL3::PolicyFactory::create_policy (CORBA::PolicyType type, 00017 const CORBA::Any & value) 00018 { 00019 CORBA::Policy_ptr policy = CORBA::Policy_ptr (); 00020 00021 if (type == SecurityLevel3::ContextEstablishmentPolicyType) 00022 { 00023 SecurityLevel3::ContextEstablishmentPolicyArgument * arg = 0; 00024 if (!(value >>= arg)) 00025 throw CORBA::INTERNAL (); 00026 00027 ACE_NEW_THROW_EX (policy, 00028 TAO::SL3::ContextEstablishmentPolicy ( 00029 arg->creds_directive, 00030 arg->creds_list, 00031 arg->use_client_auth, 00032 arg->use_target_auth, 00033 arg->use_confidentiality, 00034 arg->use_integrity), 00035 CORBA::NO_MEMORY ()); 00036 } 00037 else if (type == SecurityLevel3::ObjectCredentialsPolicyType) 00038 { 00039 SecurityLevel3::ObjectCredentialsPolicyArgument * creds = 0; 00040 if (!(value >>= creds)) 00041 throw CORBA::INTERNAL (); 00042 00043 ACE_NEW_THROW_EX (policy, 00044 TAO::SL3::ObjectCredentialsPolicy (*creds), 00045 CORBA::NO_MEMORY ()); 00046 } 00047 else 00048 { 00049 throw CORBA::PolicyError (CORBA::BAD_POLICY_TYPE); 00050 } 00051 00052 return policy; 00053 } |