SL3_PolicyFactory.cpp File Reference

#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:

Include dependency graph

Go to the source code of this file.

Functions

 ACE_RCSID (Security, SL3_PolicyFactory,"SL3_PolicyFactory.cpp, v 1.4 2006/03/14 06:14:35 jtc Exp") TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA


Function Documentation

ACE_RCSID Security  ,
SL3_PolicyFactory  ,
"SL3_PolicyFactory.  cpp,
v 1.4 2006/03/14 06:14:35 jtc Exp" 
 

Definition at line 8 of file SL3_PolicyFactory.cpp.

References CORBA::Policy::_nil(), ACE_CHECK_RETURN, ACE_NEW_THROW_EX, ACE_THROW_RETURN, and TAO_BEGIN_VERSIONED_NAMESPACE_DECL.

00010                                                      :14:35 jtc Exp")
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                                         ACE_ENV_ARG_DECL)
00019   ACE_THROW_SPEC ((CORBA::SystemException,
00020                    CORBA::PolicyError))
00021 {
00022   CORBA::Policy_ptr policy = CORBA::Policy::_nil ();
00023 
00024   if (type == SecurityLevel3::ContextEstablishmentPolicyType)
00025     {
00026       SecurityLevel3::ContextEstablishmentPolicyArgument * arg = 0;
00027       if (!(value >>= arg))
00028         ACE_THROW_RETURN (CORBA::INTERNAL (),
00029                           policy);
00030 
00031       ACE_NEW_THROW_EX (policy,
00032                         TAO::SL3::ContextEstablishmentPolicy (
00033                           arg->creds_directive,
00034                           arg->creds_list,
00035                           arg->use_client_auth,
00036                           arg->use_target_auth,
00037                           arg->use_confidentiality,
00038                           arg->use_integrity),
00039                         CORBA::NO_MEMORY ());
00040       ACE_CHECK_RETURN (policy);
00041     }
00042   else if (type == SecurityLevel3::ObjectCredentialsPolicyType)
00043     {
00044       SecurityLevel3::ObjectCredentialsPolicyArgument * creds = 0;
00045       if (!(value >>= creds))
00046         ACE_THROW_RETURN (CORBA::INTERNAL (),
00047                           policy);
00048 
00049       ACE_NEW_THROW_EX (policy,
00050                         TAO::SL3::ObjectCredentialsPolicy (*creds),
00051                         CORBA::NO_MEMORY ());
00052       ACE_CHECK_RETURN (policy);
00053     }
00054   else
00055     {
00056       ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
00057                         policy);
00058     }
00059 
00060   return policy;
00061 }


Generated on Thu Nov 9 13:51:31 2006 for TAO_Security by doxygen 1.3.6