CppWAMP
C++11 client library for the WAMP protocol
wamp::SessionInfo Class Reference

Session information contained within WAMP WELCOME messages. More...

#include <cppwamp/peerdata.hpp>

Inheritance diagram for wamp::SessionInfo:

Public Types

using RoleSet = std::set< String >
 A set of role strings.
 
using FeatureSet = std::set< String >
 A set of feature strings.
 
using FeatureMap = std::map< String, FeatureSet >
 A dictionary of feature sets to be supported by each role.
 

Public Member Functions

 SessionInfo ()
 Default constructor.
 
SessionId id () const
 Obtains the WAMP session ID.
 
const Stringrealm () const
 Obtains realm URI.
 
Agent Identification
String agentString () const
 Obtains the agent string of the WAMP router, if available. More...
 
Role and Feature Announcement
Object roles () const
 Obtains the WELCOME.Details.roles dictionary for the router. More...
 
bool supportsRoles (const RoleSet &roles) const
 Checks that the router supports the given set of roles. More...
 
bool supportsFeatures (const FeatureMap &features) const
 Checks that the router supports the given map of features. More...
 
Authentication
Variant authId () const
 Obtains the authentication ID the client was actually authenticated as. More...
 
Variant authRole () const
 Obtains the role the client was authenticated for. More...
 
Variant authMethod () const
 Obtains the method that was used for authentication. More...
 
Variant authProvider () const
 Obtains the authentication provider. More...
 

Detailed Description

Session information contained within WAMP WELCOME messages.

Member Function Documentation

◆ agentString()

String wamp::SessionInfo::agentString ( ) const

Obtains the agent string of the WAMP router, if available.

Returns
The value of the HELLO.Details.agent|string detail, or an empty string if it is not available.

◆ roles()

Object wamp::SessionInfo::roles ( ) const

Obtains the WELCOME.Details.roles dictionary for the router.

Returns
The value of the HELLO.Details.roles|dict detail, or an empty Object if it is not available.

◆ supportsRoles()

bool wamp::SessionInfo::supportsRoles ( const RoleSet roles) const

Checks that the router supports the given set of roles.

Possible role strings include:

  • broker
  • dealer
Example
bool supported = sessionInfo.supportsRoles({"broker", "dealer"});

◆ supportsFeatures()

bool wamp::SessionInfo::supportsFeatures ( const FeatureMap features) const

Checks that the router supports the given map of features.

Example
bool supported = sessionInfo.supportsFeatures(
{
{ "broker", {"publisher_exclusion", "publisher_identification"} },
{ "dealer", {"call_canceling"} }
});

◆ authId()

Variant wamp::SessionInfo::authId ( ) const

Obtains the authentication ID the client was actually authenticated as.

This function returns the value of the HELLO.Details.authid|string detail.

Returns
A string variant if the authentication ID is available. Otherwise, a null variant is returned.

◆ authRole()

Variant wamp::SessionInfo::authRole ( ) const

Obtains the role the client was authenticated for.

This function returns the value of the HELLO.Details.authrole|string detail. This is not to be confused with the dealer roles.

Returns
A string variant if the authentication role is available. Otherwise, a null variant is returned.

◆ authMethod()

Variant wamp::SessionInfo::authMethod ( ) const

Obtains the method that was used for authentication.

This function returns the value of the HELLO.Details.authmethod|string detail.

Returns
A string variant if the authentication method is available. Otherwise, a null variant is returned.

◆ authProvider()

Variant wamp::SessionInfo::authProvider ( ) const

Obtains the authentication provider.

This function returns the value of the HELLO.Details.authprovider|string detail.

Returns
A string variant if the authentication provider is available. Otherwise, a null variant is returned.

The documentation for this class was generated from the following files: