TAO_Security_Current Class Reference

Implementation of the SecurityLevel2::Current interface. More...

#include <Security_Current.h>

Inheritance diagram for TAO_Security_Current:

Inheritance graph
[legend]
Collaboration diagram for TAO_Security_Current:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Security_Current (size_t tss_slot, const char *orb_id)
 Constructor.

size_t tss_slot (void) const
 Return the TSS slot ID assigned to the "SecurityCurrent" object.

SecurityLevel1::Current Methods
These methods are founds in the SecurityLevel1::Current interface.

virtual Security::AttributeListget_attributes (const Security::AttributeTypeList &attributes)
SecurityLevel2::Current Methods
These methods are founds in the SecurityLevel2::Current interface.

virtual SecurityLevel2::ReceivedCredentials_ptr received_credentials ()

Protected Member Functions

 ~TAO_Security_Current (void)
int init (void)
TAO::Security::Current_Implimplementation (void)
 Set the TSS Security::Current implementation.


Private Member Functions

 TAO_Security_Current (const TAO_Security_Current &)
void operator= (const TAO_Security_Current &)

Private Attributes

size_t const  tss_slot_
 TSS slot assigned to this object.

CORBA::String_var orb_id_
 The ORBid of the ORB with which this object is registered.

TAO_ORB_Coreorb_core_

Detailed Description

Implementation of the SecurityLevel2::Current interface.

This object can be used to obtain session related security information about the current execution context.

Definition at line 47 of file Security_Current.h.


Constructor & Destructor Documentation

TAO_Security_Current::TAO_Security_Current size_t  tss_slot,
const char *  orb_id
 

Constructor.

TAO_Security_Current::~TAO_Security_Current void   )  [protected]
 

Destructor Protected to force allocation on the heap.

Definition at line 24 of file Security_Current.cpp.

00025 {
00026 }

TAO_Security_Current::TAO_Security_Current const TAO_Security_Current  )  [private]
 

Prevent copying through the copy constructor and the assignment operator.


Member Function Documentation

Security::AttributeList * TAO_Security_Current::get_attributes const Security::AttributeTypeList attributes  )  [virtual]
 

Return the security attributes corresponding to the types in the given attribute type list associated with the current request.

Definition at line 29 of file Security_Current.cpp.

References Security::AttributeTypeList, TAO::Security::Current_Impl::get_attributes(), and implementation().

00031 {
00032   TAO::Security::Current_Impl *impl = this->implementation ();
00033 
00034   // If the implementation pointer returned from TSS is zero, then
00035   // we're not in the middle of a request/upcall.  Throw an exception
00036   // to indicate that.
00037   if (impl == 0)
00038     throw CORBA::BAD_INV_ORDER ();
00039 
00040   return impl->get_attributes (attributes);
00041 }

ACE_INLINE TAO::Security::Current_Impl * TAO_Security_Current::implementation void   )  [protected]
 

Set the TSS Security::Current implementation.

The pointer is actually one to a concrete implementation provided by the underlying security mechanism. For example, SSLIOP implements the SecurityLevel2::Current interface. Similarly, SECIOP would do the same.

There is no function that places the implementation pointer in TSS. The underlying security mechanism does that.

Definition at line 14 of file Security_Current.inl.

References TAO_ORB_Core::get_tss_resource(), and init().

Referenced by get_attributes(), and received_credentials().

00015 {
00016   if (this->orb_core_ == 0 && this->init () != 0)
00017     return 0;
00018 
00019   TAO::Security::Current_Impl *impl =
00020     static_cast<TAO::Security::Current_Impl *> (
00021       this->orb_core_->get_tss_resource (this->tss_slot_));
00022 
00023   return impl;
00024 }

int TAO_Security_Current::init void   )  [protected]
 

Fully initialize this object. This method is used predominantly to set the ORB core pointer.

Definition at line 58 of file Security_Current.cpp.

References orb_id_, CORBA::ORB_init(), and TAO_debug_level.

Referenced by implementation().

00059 {
00060   int result = 0;
00061 
00062   try
00063     {
00064       int argc = 0;
00065       char **argv = 0;
00066       CORBA::ORB_var orb = CORBA::ORB_init (argc,
00067                                             argv,
00068                                             this->orb_id_.in ());
00069 
00070       this->orb_core_ = orb.in ()->orb_core ();
00071 
00072       // No longer need the ORBid, so reclaim the memory it was
00073       // occupying.
00074       (void) this->orb_id_.out ();
00075     }
00076   catch (const CORBA::Exception& ex)
00077     {
00078       if (TAO_debug_level >= 1)
00079         ex._tao_print_exception ("Could not initialize SecurityCurrent:");
00080 
00081       result = -1;
00082     }
00083 
00084   return result;
00085 }

void TAO_Security_Current::operator= const TAO_Security_Current  )  [private]
 

Prevent copying through the copy constructor and the assignment operator.

SecurityLevel2::ReceivedCredentials_ptr TAO_Security_Current::received_credentials  )  [virtual]
 

Return the Credentials received from the client associate with the current request.

Definition at line 44 of file Security_Current.cpp.

References implementation(), and TAO::Security::Current_Impl::received_credentials().

00045 {
00046   TAO::Security::Current_Impl *impl = this->implementation ();
00047 
00048   // If the implementation pointer returned from TSS is zero, then
00049   // we're not in the middle of a request/upcall.  Throw an exception
00050   // to indicate that.
00051   if (impl == 0)
00052     throw CORBA::BAD_INV_ORDER ();
00053 
00054   return impl->received_credentials ();
00055 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE size_t TAO_Security_Current::tss_slot void   )  const
 

Return the TSS slot ID assigned to the "SecurityCurrent" object.

The concrete TSS SecurityCurrent implementations will each use this slot ID.

Definition at line 8 of file Security_Current.inl.

References tss_slot_.

00009 {
00010   return this->tss_slot_;
00011 }


Member Data Documentation

TAO_ORB_Core* TAO_Security_Current::orb_core_ [private]
 

Pointer to the ORB Core corresponding to the ORB with which this object is registered.

Reimplemented from CORBA::Object.

Definition at line 129 of file Security_Current.h.

CORBA::String_var TAO_Security_Current::orb_id_ [private]
 

The ORBid of the ORB with which this object is registered.

Definition at line 125 of file Security_Current.h.

Referenced by init().

size_t const TAO_Security_Current::tss_slot_ [private]
 

TSS slot assigned to this object.

Definition at line 122 of file Security_Current.h.

Referenced by tss_slot().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 16:10:16 2008 for TAO_Security by doxygen 1.3.6