00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file SL2_QOPPolicy.h 00006 * 00007 * $Id: SL2_QOPPolicy.h 81490 2008-04-28 14:32:24Z johnnyw $ 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 ::CORBA::LocalObject 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 (void); 00065 00066 virtual CORBA::Policy_ptr copy (void); 00067 00068 virtual void destroy (void); 00069 //@} 00070 00071 /// Return the Quality-of-Protection value associated with this 00072 /// policy. 00073 virtual ::Security::QOP qop (void); 00074 00075 protected: 00076 00077 /// Destructor 00078 /** 00079 * Protected destructor to enforce proper memory management 00080 * through the reference counting mechansim. 00081 */ 00082 ~QOPPolicy (void); 00083 00084 private: 00085 00086 /// Quality of protection which can be specified for an object 00087 /// reference and used to protect messages. 00088 ::Security::QOP const qop_; 00089 00090 }; 00091 00092 } // End Security namespace 00093 } // End TAO namespace 00094 00095 TAO_END_VERSIONED_NAMESPACE_DECL 00096 00097 #include /**/ "ace/post.h" 00098 00099 #endif /* TAO_SL2_QOP_POLICY_H */