NAP
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
WebSocketTicket Class Reference

#include <websocketticket.h>

Public Member Functions

 WebSocketTicket ()=default
 
virtual bool init (utility::ErrorState &errorState) override
 
bool toBinaryString (std::string &outString, utility::ErrorState &error)
 
WebSocketTicketHash toHash () const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Static Public Member Functions

static WebSocketTicketfromBinaryString (const std::string &binaryString, rtti::DeserializeResult &result, utility::ErrorState &error)
 
- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Public Attributes

std::string mUsername = ""
 Property: 'UserName'. More...
 
std::string mPassword = ""
 Property: 'Password'. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Description

Created and issued by a nap::WebSocketServerEndPoint. A ticket is used by a server end-point to reject or accept a client connection request. For more information on authorization look refer to the nap::WebSocketServerEndPoint documentation.

Inheritance diagram for WebSocketTicket:
[legend]
Collaboration diagram for WebSocketTicket:
[legend]

Constructor & Destructor Documentation

◆ WebSocketTicket()

WebSocketTicket ( )
default

Member Function Documentation

◆ fromBinaryString()

static WebSocketTicket* fromBinaryString ( const std::string &  binaryString,
rtti::DeserializeResult result,
utility::ErrorState error 
)
static

Creates a web-socket ticket based on a previously acquired binary string.

Parameters
binaryStringthe binary string representation of a ticket.
resultcontains the result of the de-serialization step. Ticket is destructed when results are out of scope.
errorcontains the error if conversion fails.
Returns
the web-socket ticket, nullptr if conversion fails

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Initialize this object after de-serialization

Parameters
errorStatecontains the error message when initialization fails

Reimplemented from Object.

◆ toBinaryString()

bool toBinaryString ( std::string &  outString,
utility::ErrorState error 
)

Converts this ticket into a binary string representation.

Parameters
outStringcontains the result of the conversion
errorcontains the error if conversion fails.
Returns
if conversion succeeded.

◆ toHash()

WebSocketTicketHash toHash ( ) const

Creates a hash-able ticket based on the info in this ticket.

Returns
hashable ticket representation.

Member Data Documentation

◆ mPassword

std::string mPassword = ""

Property: 'Password'.

◆ mUsername

std::string mUsername = ""

Property: 'UserName'.