00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file SL2_EstablishTrustPolicy.h 00006 * 00007 * $Id: SL2_EstablishTrustPolicy.h 77001 2007-02-12 07:54:49Z johnnyw $ 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 // =================================================================== 00012 00013 00014 #ifndef TAO_ESTABLISH_TRUST_POLICY_H 00015 #define TAO_ESTABLISH_TRUST_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 /** 00037 * @class EstablishTrustPolicy 00038 * 00039 * @brief Implementation of the 00040 * SecurityLevel2::EstablishTrustPolicy. 00041 * 00042 * This policy can be used to enable or disable establishment of 00043 * trust in the client or the target or both on a per-object 00044 * basis. For example, it can be set as a policy override using 00045 * the standard CORBA::Object::_set_policy_overrides() method. 00046 @par 00047 * This policy can be created by using the 00048 * CORBA::ORB::create_policy() method by passing it the 00049 * Security::SecEstablishTrustPolicy policy type, and the 00050 * 00051 * appropriate Security::EstablishTrust structure (inserted into a 00052 * CORBA::Any). 00053 */ 00054 class EstablishTrustPolicy 00055 : public virtual SecurityLevel2::EstablishTrustPolicy, 00056 public virtual TAO_Local_RefCounted_Object 00057 { 00058 public: 00059 00060 /// Constructor 00061 EstablishTrustPolicy (const ::Security::EstablishTrust &trust); 00062 00063 /** 00064 * @name CORBA::Policy Methods 00065 */ 00066 //@{ 00067 virtual CORBA::PolicyType policy_type (void); 00068 00069 virtual CORBA::Policy_ptr copy (void); 00070 00071 virtual void destroy (void); 00072 //@} 00073 00074 /// Return the "establish trust" value associated with this 00075 /// policy. 00076 virtual ::Security::EstablishTrust trust (void); 00077 00078 protected: 00079 00080 /// Destructor 00081 /** 00082 * Protected destructor to enforce proper memory management 00083 * through the reference counting mechanism. 00084 */ 00085 ~EstablishTrustPolicy (void); 00086 00087 private: 00088 00089 /// Quality of protection which can be specified for an object 00090 /// reference and used to protect messages. 00091 ::Security::EstablishTrust const trust_; 00092 00093 }; 00094 00095 } // End Security namespace 00096 } // End TAO namespace 00097 00098 TAO_END_VERSIONED_NAMESPACE_DECL 00099 00100 #include /**/ "ace/post.h" 00101 00102 #endif /* TAO_ESTABLISH_TRUST_POLICY_H */