00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file SL2_QOPPolicy.h 00006 * 00007 * SL2_QOPPolicy.h,v 1.4 2006/03/14 06:14:35 jtc Exp 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 // =================================================================== 00012 00013 00014 #ifndef TAO_SL2_QOP_POLICY_H 00015 #define TAO_SL2_QOP_POLICY_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "orbsvcs/Security/security_export.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "orbsvcs/SecurityLevel2C.h" 00026 00027 #include "tao/LocalObject.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace TAO 00032 { 00033 namespace Security 00034 { 00035 /** 00036 * @class QOPPolicy 00037 * 00038 * @brief Implementation of the SecurityLevel2::QOPPolicy 00039 * interface. 00040 * 00041 * This policy can be used to affect the quality of protection 00042 * (QoP) for invocation on a per-object basis. For example, it 00043 * can be set as a policy override using the standard 00044 * CORBA::Object::_set_policy_overrides() method. 00045 * @par 00046 * This policy can be created by using the 00047 * CORBA::ORB::create_policy() method by passing it the 00048 * Security::SecQOPPolicy policy type, and the appropriate 00049 * Security::QOP enumeration (inserted into a CORBA::Any). 00050 */ 00051 class QOPPolicy 00052 : public virtual SecurityLevel2::QOPPolicy, 00053 public virtual TAO_Local_RefCounted_Object 00054 { 00055 public: 00056 00057 /// Constructor 00058 QOPPolicy (::Security::QOP qop); 00059 00060 /** 00061 * @name CORBA::Policy Methods 00062 */ 00063 //@{ 00064 virtual CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL) 00065 ACE_THROW_SPEC ((CORBA::SystemException)); 00066 00067 virtual CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL) 00068 ACE_THROW_SPEC ((CORBA::SystemException)); 00069 00070 virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) 00071 ACE_THROW_SPEC ((CORBA::SystemException)); 00072 //@} 00073 00074 /// Return the Quality-of-Protection value associated with this 00075 /// policy. 00076 virtual ::Security::QOP qop (ACE_ENV_SINGLE_ARG_DECL) 00077 ACE_THROW_SPEC ((CORBA::SystemException)); 00078 00079 protected: 00080 00081 /// Destructor 00082 /** 00083 * Protected destructor to enforce proper memory management 00084 * through the reference counting mechansim. 00085 */ 00086 ~QOPPolicy (void); 00087 00088 private: 00089 00090 /// Quality of protection which can be specified for an object 00091 /// reference and used to protect messages. 00092 ::Security::QOP const qop_; 00093 00094 }; 00095 00096 } // End Security namespace 00097 } // End TAO namespace 00098 00099 TAO_END_VERSIONED_NAMESPACE_DECL 00100 00101 #include /**/ "ace/post.h" 00102 00103 #endif /* TAO_SL2_QOP_POLICY_H */