OpenDDS::Security::TokenWriter Class Reference

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

#include <TokenWriter.h>

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

List of all members.

Public Member Functions

 TokenWriter (DDS::Security::Token &token_ref)
 TokenWriter (DDS::Security::Token &token_ref, const std::string &class_id)
virtual ~TokenWriter ()
const TokenReaderget_reader ()
void set_class_id (const std::string &class_name)
void add_property (const char *prop_name, const char *prop_value, bool propagate=true)
void add_property (const char *prop_name, const DDS::OctetSeq &prop_value, bool propagate=true)
void add_bin_property (const char *prop_name, const DDS::OctetSeq &prop_value, bool propagate=true)
void add_bin_property (const char *prop_name, const std::string &prop_value, bool propagate=true)

Private Attributes

DCPS::SequenceBackInsertIterator
< DDS::BinaryPropertySeq
binary_property_inserter_
DCPS::SequenceBackInsertIterator
< DDS::PropertySeq
property_inserter_
DDS::Security::Tokentoken_ref_
OpenDDS::Security::TokenReader reader_

Detailed Description

Implements some simple wrapper functions to provide a non-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 41 of file TokenWriter.h.


Constructor & Destructor Documentation

OpenDDS::Security::TokenWriter::TokenWriter ( DDS::Security::Token token_ref  ) 

Definition at line 16 of file TokenWriter.cpp.

00017 : binary_property_inserter_(token_ref.binary_properties)
00018 , property_inserter_(token_ref.properties)
00019 , token_ref_(token_ref)
00020 , reader_(token_ref)
00021 {
00022 
00023 }

OpenDDS::Security::TokenWriter::TokenWriter ( DDS::Security::Token token_ref,
const std::string &  class_id 
)

Definition at line 25 of file TokenWriter.cpp.

References DDS::Security::DataHolder::class_id.

00026 : binary_property_inserter_(token_ref.binary_properties)
00027 , property_inserter_(token_ref.properties)
00028 , token_ref_(token_ref)
00029 , reader_(token_ref)
00030 {
00031   token_ref.class_id = class_id.c_str();
00032 }

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

Definition at line 34 of file TokenWriter.cpp.

00035 {
00036 }


Member Function Documentation

void OpenDDS::Security::TokenWriter::add_bin_property ( const char *  prop_name,
const std::string &  prop_value,
bool  propagate = true 
)

Definition at line 68 of file TokenWriter.cpp.

References binary_property_inserter_, DDS::BinaryProperty_t::name, DDS::BinaryProperty_t::propagate, and DDS::BinaryProperty_t::value.

00069 {
00070   DDS::BinaryProperty_t p;
00071   p.name = prop_name;
00072   p.propagate = propagate;
00073   p.value.length(prop_value.length() + 1 /* For null */);
00074   std::memcpy(p.value.get_buffer(),
00075               prop_value.c_str(),
00076               p.value.length());
00077   *binary_property_inserter_ = p;
00078 }

void OpenDDS::Security::TokenWriter::add_bin_property ( const char *  prop_name,
const DDS::OctetSeq prop_value,
bool  propagate = true 
)
void OpenDDS::Security::TokenWriter::add_property ( const char *  prop_name,
const DDS::OctetSeq prop_value,
bool  propagate = true 
)

Definition at line 47 of file TokenWriter.cpp.

References DDS::Property_t::name, DDS::Property_t::propagate, property_inserter_, and DDS::Property_t::value.

00048 {
00049   std::ostringstream out;
00050   out.write(reinterpret_cast<const char*>(prop_value.get_buffer()), prop_value.length());
00051 
00052   DDS::Property_t p;
00053   p.name = prop_name;
00054   p.value = out.str().c_str();
00055   p.propagate = propagate;
00056   *property_inserter_ = p;
00057 }

void OpenDDS::Security::TokenWriter::add_property ( const char *  prop_name,
const char *  prop_value,
bool  propagate = true 
)

Definition at line 38 of file TokenWriter.cpp.

References DDS::Property_t::name, DDS::Property_t::propagate, property_inserter_, and DDS::Property_t::value.

Referenced by OpenDDS::Security::AuthenticationBuiltInImpl::get_identity_token(), and OpenDDS::Security::AccessControlBuiltInImpl::validate_local_permissions().

00039 {
00040   DDS::Property_t p;
00041   p.name = prop_name;
00042   p.value = prop_value;
00043   p.propagate = propagate;
00044   *property_inserter_ = p;
00045 }

Here is the caller graph for this function:

const TokenReader & OpenDDS::Security::TokenWriter::get_reader (  )  [inline]

Definition at line 65 of file TokenWriter.h.

References reader_.

00066 {
00067   return reader_;
00068 }

void OpenDDS::Security::TokenWriter::set_class_id ( const std::string &  class_name  )  [inline]

Definition at line 70 of file TokenWriter.h.

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

00071 {
00072   token_ref_.class_id = class_id.c_str();
00073 }


Member Data Documentation

Definition at line 59 of file TokenWriter.h.

Referenced by add_bin_property().

Definition at line 60 of file TokenWriter.h.

Referenced by add_property().

Definition at line 62 of file TokenWriter.h.

Referenced by get_reader().

Definition at line 61 of file TokenWriter.h.

Referenced by set_class_id().


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