00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file Security_Current.h 00006 * 00007 * Security_Current.h,v 1.13 2006/03/14 06:14:35 jtc Exp 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_SECURITY_CURRENT_H 00014 #define TAO_SECURITY_CURRENT_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "orbsvcs/Security/security_export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "orbsvcs/SecurityLevel2C.h" 00025 #include "tao/ORB_Core.h" 00026 #include "tao/LocalObject.h" 00027 00028 #include "orbsvcs/Security/Security_Current_Impl.h" 00029 00030 // This is to remove "inherits via dominance" warnings from MSVC. 00031 // MSVC is being a little too paranoid. 00032 #if defined(_MSC_VER) 00033 #pragma warning(push) 00034 #pragma warning(disable:4250) 00035 #endif /* _MSC_VER */ 00036 00037 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00038 00039 /** 00040 * @class TAO_Security_Current 00041 * 00042 * @brief Implementation of the SecurityLevel2::Current interface. 00043 * 00044 * This object can be used to obtain session related security 00045 * information about the current execution context. 00046 */ 00047 class TAO_Security_Export TAO_Security_Current 00048 : public SecurityLevel2::Current, 00049 public TAO_Local_RefCounted_Object 00050 { 00051 public: 00052 00053 /// Constructor. 00054 TAO_Security_Current (size_t tss_slot, const char *orb_id); 00055 00056 /** 00057 * @name SecurityLevel1::Current Methods 00058 * 00059 * These methods are founds in the SecurityLevel1::Current 00060 * interface. 00061 */ 00062 //@{ 00063 /// Return the security attributes corresponding to the types in the 00064 /// given attribute type list associated with the current request. 00065 virtual Security::AttributeList * get_attributes ( 00066 const Security::AttributeTypeList & attributes 00067 ACE_ENV_ARG_DECL_WITH_DEFAULTS) 00068 ACE_THROW_SPEC ((CORBA::SystemException)); 00069 //@} 00070 00071 /** 00072 * @name SecurityLevel2::Current Methods 00073 * 00074 * These methods are founds in the SecurityLevel2::Current 00075 * interface. 00076 */ 00077 //@{ 00078 /// Return the Credentials received from the client associate with 00079 /// the current request. 00080 virtual SecurityLevel2::ReceivedCredentials_ptr received_credentials ( 00081 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) 00082 ACE_THROW_SPEC ((CORBA::SystemException)); 00083 //@} 00084 00085 /// Return the TSS slot ID assigned to the "SecurityCurrent" object. 00086 /** 00087 * The concrete TSS SecurityCurrent implementations will each use 00088 * this slot ID. 00089 */ 00090 size_t tss_slot (void) const; 00091 00092 protected: 00093 00094 /// Destructor 00095 /// Protected to force allocation on the heap. 00096 ~TAO_Security_Current (void); 00097 00098 /// Fully initialize this object. This method is used predominantly 00099 /// to set the ORB core pointer. 00100 int init (void); 00101 00102 /// Set the TSS Security::Current implementation. 00103 /** 00104 * The pointer is actually one to a concrete implementation provided 00105 * by the underlying security mechanism. For example, SSLIOP 00106 * implements the SecurityLevel2::Current interface. Similarly, 00107 * SECIOP would do the same. 00108 * 00109 * There is no function that places the implementation pointer in 00110 * TSS. The underlying security mechanism does that. 00111 */ 00112 TAO::Security::Current_Impl *implementation (void); 00113 00114 private: 00115 00116 /// Prevent copying through the copy constructor and the assignment 00117 /// operator. 00118 //@{ 00119 TAO_Security_Current (const TAO_Security_Current &); 00120 void operator= (const TAO_Security_Current &); 00121 //@} 00122 00123 private: 00124 00125 /// TSS slot assigned to this object. 00126 size_t const tss_slot_; 00127 00128 /// The ORBid of the ORB with which this object is registered. 00129 CORBA::String_var orb_id_; 00130 00131 /// Pointer to the ORB Core corresponding to the ORB with which this 00132 /// object is registered. 00133 TAO_ORB_Core * orb_core_; 00134 00135 }; 00136 00137 TAO_END_VERSIONED_NAMESPACE_DECL 00138 00139 #if defined (__ACE_INLINE__) 00140 # include "orbsvcs/Security/Security_Current.inl" 00141 #endif /* __ACE_INLINE__ */ 00142 00143 #if defined(_MSC_VER) 00144 #pragma warning(pop) 00145 #endif /* _MSC_VER */ 00146 00147 #include /**/ "ace/post.h" 00148 00149 #endif /* TAO_SECURITY_CURRENT_H */