OpenDDS::Security::TokenReader Class Reference

Implements some simple wrapper functions to provide a const API around the Token data structure as specified in the DDS security specification. More...

#include <TokenReader.h>

Collaboration diagram for OpenDDS::Security::TokenReader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TokenReader (const DDS::Security::Token &token_ref)
virtual ~TokenReader ()
bool is_nil () const
const char * get_property_value (const std::string &property_name) const
const DDS::OctetSeqget_bin_property_value (const std::string &property_name) const
CORBA::ULong get_num_properties () const
CORBA::ULong get_num_bin_properties () const

Private Attributes

const DDS::Security::Tokentoken_ref_
const DDS::OctetSeq _empty_seq_

Detailed Description

Implements some simple wrapper functions to provide a const API around the Token data structure as specified in the DDS security specification.

See the DDS security specification, OMG formal/17-09-20, for a description of the interface this class is implementing.

Definition at line 40 of file TokenReader.h.


Constructor & Destructor Documentation

OpenDDS::Security::TokenReader::TokenReader ( const DDS::Security::Token token_ref  ) 

Definition at line 33 of file TokenReader.cpp.

00034 : token_ref_(token_ref)
00035 , _empty_seq_()
00036 {
00037 }

OpenDDS::Security::TokenReader::~TokenReader (  )  [virtual]

Definition at line 39 of file TokenReader.cpp.

00040 {
00041 }


Member Function Documentation

const DDS::OctetSeq & OpenDDS::Security::TokenReader::get_bin_property_value ( const std::string &  property_name  )  const

Definition at line 60 of file TokenReader.cpp.

References _empty_seq_, DDS::Security::DataHolder::binary_properties, OpenDDS::DCPS::const_sequence_begin(), OpenDDS::DCPS::const_sequence_end(), and token_ref_.

Referenced by OpenDDS::Security::AuthenticationBuiltInImpl::begin_handshake_reply(), OpenDDS::Security::AuthenticationBuiltInImpl::begin_handshake_request(), OpenDDS::Security::AuthenticationBuiltInImpl::process_final_handshake(), OpenDDS::Security::AuthenticationBuiltInImpl::process_handshake_reply(), and OpenDDS::Security::AccessControlBuiltInImpl::validate_remote_permissions().

00061 {
00062   typedef ConstSequenceIterator<const DDS::BinaryPropertySeq> iter_t;
00063   typedef has_property<const DDS::BinaryProperty_t> has_property;
00064 
00065   iter_t begin = const_sequence_begin(token_ref_.binary_properties),
00066          end = const_sequence_end(token_ref_.binary_properties);
00067 
00068   iter_t result = std::find_if(begin, end, has_property(property_name));
00069 
00070   if (result != end) {
00071     return result->value;
00072   }
00073 
00074   return _empty_seq_;
00075 }

Here is the call graph for this function:

Here is the caller graph for this function:

CORBA::ULong OpenDDS::Security::TokenReader::get_num_bin_properties (  )  const [inline]

Definition at line 71 of file TokenReader.h.

References DDS::Security::DataHolder::binary_properties, and token_ref_.

00072 {
00073   return token_ref_.binary_properties.length();
00074 }

CORBA::ULong OpenDDS::Security::TokenReader::get_num_properties (  )  const [inline]

Definition at line 66 of file TokenReader.h.

References DDS::Security::DataHolder::properties, and token_ref_.

00067 {
00068   return token_ref_.properties.length();
00069 }

const char * OpenDDS::Security::TokenReader::get_property_value ( const std::string &  property_name  )  const

Definition at line 43 of file TokenReader.cpp.

References OpenDDS::DCPS::const_sequence_begin(), OpenDDS::DCPS::const_sequence_end(), DDS::Security::DataHolder::properties, and token_ref_.

Referenced by OpenDDS::Security::AccessControlBuiltInImpl::validate_local_permissions().

00044 {
00045   typedef ConstSequenceIterator<const DDS::PropertySeq> iter_t;
00046   typedef has_property<const DDS::Property_t> has_property;
00047 
00048   iter_t begin = const_sequence_begin(token_ref_.properties),
00049          end = const_sequence_end(token_ref_.properties);
00050 
00051   iter_t result = std::find_if(begin, end, has_property(property_name));
00052 
00053   if (result != end) {
00054     return result->value;
00055   }
00056 
00057   return 0;
00058 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OpenDDS::Security::TokenReader::is_nil ( void   )  const [inline]

Member Data Documentation

Definition at line 56 of file TokenReader.h.

Referenced by get_bin_property_value().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1