VMime
SASLMechanismFactory Class Reference

#include <SASLMechanismFactory.hpp>

Inheritance diagram for SASLMechanismFactory:
Collaboration diagram for SASLMechanismFactory:

Public Member Functions

template<typename MECH_CLASS>
void registerMechanism (const string &name)
shared_ptr< SASLMechanismcreate (shared_ptr< SASLContext > ctx, const string &name)
const std::vector< stringgetSupportedMechanisms () const
bool isMechanismSupported (const string &name) const
bool isBuiltinMechanism (const string &name) const

Static Public Member Functions

static SASLMechanismFactory * getInstance ()

Additional Inherited Members

Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

Constructs SASL mechanism objects.

Member Function Documentation

◆ create()

shared_ptr< SASLMechanism > create ( shared_ptr< SASLContext > ctx,
const string & name )

Create a mechanism object given its name.

Parameters
ctxSASL context
namemechanism name
Returns
a new mechanism object
Exceptions
exceptions::no_such_mechanismif no mechanism is registered for the specified name

References isBuiltinMechanism(), and stringUtils::toUpper().

Referenced by SASLContext::createMechanism().

◆ getInstance()

SASLMechanismFactory * getInstance ( )
static

◆ getSupportedMechanisms()

const std::vector< string > getSupportedMechanisms ( ) const

Return a list of supported mechanisms.

This includes mechanisms registered using registerMechanism() as well as the ones that are built-in.

Returns
list of supported mechanisms

◆ isBuiltinMechanism()

bool isBuiltinMechanism ( const string & name) const

Test whether an authentication mechanism is directly supported by the underlying SASL library.

Parameters
namemechanism name
Returns
true if the specified mechanism is built-in, or false otherwise

Referenced by create(), and isMechanismSupported().

◆ isMechanismSupported()

bool isMechanismSupported ( const string & name) const

Test whether an authentication mechanism is supported.

Parameters
namemechanism name
Returns
true if the specified mechanism is supported, false otherwise

References isBuiltinMechanism().

◆ registerMechanism()

template<typename MECH_CLASS>
void registerMechanism ( const string & name)

Register a mechanism into this factory, so that subsequent calls to create return a valid object for this mechanism.

Parameters
namemechanism name

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