xmltooling  1.6.4
xmltooling::XMLToolingConfig Class Referenceabstract

Singleton object that manages library startup/shutdown.configuration. More...

#include <xmltooling/XMLToolingConfig.h>

Inheritance diagram for xmltooling::XMLToolingConfig:
xmltooling::Lockable

Public Types

enum  XMLSecurityAlgorithmType {
  ALGTYPE_UNK, ALGTYPE_DIGEST, ALGTYPE_SIGN, ALGTYPE_ENCRYPT,
  ALGTYPE_KEYENCRYPT, ALGTYPE_KEYAGREE, ALGTYPE_AUTHNENCRYPT
}
 Types of XML Security algorithms.
 

Public Member Functions

virtual bool init ()=0
 Initializes library. More...
 
virtual void term ()=0
 Shuts down library. More...
 
virtual bool load_library (const char *path, void *context=0)=0
 Loads a shared/dynamic library extension. More...
 
virtual bool log_config (const char *config=0)=0
 Configure logging system. More...
 
virtual ParserPoolgetParser () const =0
 Obtains a non-validating parser pool. More...
 
virtual ParserPoolgetValidatingParser () const =0
 Obtains a validating parser pool. More...
 
virtual MutexgetNamedMutex (const char *name)=0
 Returns a reference to a named mutex. More...
 
const KeyInfoResolvergetKeyInfoResolver () const
 Returns the global KeyInfoResolver instance. More...
 
ReplayCachegetReplayCache () const
 Returns the global ReplayCache instance. More...
 
void setKeyInfoResolver (KeyInfoResolver *keyInfoResolver)
 Sets the global KeyInfoResolver instance. More...
 
void setReplayCache (ReplayCache *replayCache)
 Sets the global ReplayCache instance. More...
 
PathResolvergetPathResolver () const
 Returns the global PathResolver instance. More...
 
TemplateEnginegetTemplateEngine () const
 Returns the global TemplateEngine instance. More...
 
const URLEncodergetURLEncoder () const
 Returns the global URLEncoder instance. More...
 
void setPathResolver (PathResolver *pathResolver)
 Sets the global PathResolver instance. More...
 
void setTemplateEngine (TemplateEngine *templateEngine)
 Sets the global TemplateEngine instance. More...
 
void setURLEncoder (URLEncoder *urlEncoder)
 Sets the global URLEncoder instance. More...
 
virtual XSECCryptoX509CRLX509CRL () const =0
 Returns an X.509 CRL implementation object.
 
virtual std::pair< const char *, unsigned int > mapXMLAlgorithmToKeyAlgorithm (const XMLCh *xmlAlgorithm) const =0
 Maps an XML Signature/Encryption algorithm identifier to a library-specific key algorithm and size for use in resolving credentials. More...
 
virtual void registerXMLAlgorithm (const XMLCh *xmlAlgorithm, const char *keyAlgorithm, unsigned int size=0, XMLSecurityAlgorithmType type=ALGTYPE_UNK)=0
 Registers an XML Signature/Encryption algorithm identifier against a library-specific key algorithm and size for use in resolving credentials. More...
 
virtual bool isXMLAlgorithmSupported (const XMLCh *xmlAlgorithm, XMLSecurityAlgorithmType type=ALGTYPE_UNK)=0
 Checks for implementation support of a particular XML Security algorithm. More...
 
- Public Member Functions inherited from xmltooling::Lockable
virtual Lockablelock ()=0
 Lock the associated object for exclusive access. More...
 
virtual void unlock ()=0
 Unlock the associated object from exclusive access.
 

Static Public Member Functions

static XMLToolingConfiggetConfig ()
 Returns the global configuration object for the library. More...
 

Public Attributes

std::string catalog_path
 
std::string user_agent
 A User-Agent header to include in HTTP client requests. More...
 
unsigned int clock_skew_secs
 Adjusts any clock comparisons to be more liberal/permissive by the indicated number of seconds.
 
PluginManager< StorageService, std::string, const xercesc::DOMElement * > StorageServiceManager
 Manages factories for StorageService plugins.
 
PluginManager< CredentialResolver, std::string, const xercesc::DOMElement * > CredentialResolverManager
 Manages factories for CredentialResolver plugins.
 
PluginManager< KeyInfoResolver, std::string, const xercesc::DOMElement * > KeyInfoResolverManager
 Manages factories for KeyInfoResolver plugins.
 
PluginManager< PathValidator, std::string, const xercesc::DOMElement * > PathValidatorManager
 Manages factories for PathValidator plugins.
 
PluginManager< TrustEngine, std::string, const xercesc::DOMElement * > TrustEngineManager
 Manages factories for TrustEngine plugins.
 
PluginManager< SOAPTransport, std::string, SOAPTransport::AddressSOAPTransportManager
 Manages factories for SOAPTransport plugins. More...
 

Protected Attributes

KeyInfoResolverm_keyInfoResolver
 Global KeyInfoResolver instance. More...
 
ReplayCachem_replayCache
 Global ReplayCache instance. More...
 
PathResolverm_pathResolver
 Global PathResolver instance. More...
 
TemplateEnginem_templateEngine
 Global TemplateEngine instance. More...
 
URLEncoderm_urlEncoder
 Global URLEncoder instance for use by URL-related functions. More...
 

Detailed Description

Singleton object that manages library startup/shutdown.configuration.

A locking interface is supplied as a convenience for code that wants to obtain a global system lock, but the actual configuration itself is not synchronized.

Member Function Documentation

◆ getConfig()

static XMLToolingConfig& xmltooling::XMLToolingConfig::getConfig ( )
static

Returns the global configuration object for the library.

Returns
reference to the global library configuration object

◆ getKeyInfoResolver()

const KeyInfoResolver* xmltooling::XMLToolingConfig::getKeyInfoResolver ( ) const

Returns the global KeyInfoResolver instance.

Returns
global KeyInfoResolver or nullptr

◆ getNamedMutex()

virtual Mutex& xmltooling::XMLToolingConfig::getNamedMutex ( const char *  name)
pure virtual

Returns a reference to a named mutex.

The first access to a given name will create the object.

Parameters
namename of mutex to access
Returns
reference to a mutex object

◆ getParser()

virtual ParserPool& xmltooling::XMLToolingConfig::getParser ( ) const
pure virtual

Obtains a non-validating parser pool.

Library must be initialized first.

Returns
reference to a non-validating parser pool.

◆ getPathResolver()

PathResolver* xmltooling::XMLToolingConfig::getPathResolver ( ) const

Returns the global PathResolver instance.

Returns
global PathResolver or nullptr

◆ getReplayCache()

ReplayCache* xmltooling::XMLToolingConfig::getReplayCache ( ) const

Returns the global ReplayCache instance.

Returns
global ReplayCache or nullptr

◆ getTemplateEngine()

TemplateEngine* xmltooling::XMLToolingConfig::getTemplateEngine ( ) const

Returns the global TemplateEngine instance.

Returns
global TemplateEngine or nullptr

◆ getURLEncoder()

const URLEncoder* xmltooling::XMLToolingConfig::getURLEncoder ( ) const

Returns the global URLEncoder instance.

Returns
global URLEncoder or nullptr

◆ getValidatingParser()

virtual ParserPool& xmltooling::XMLToolingConfig::getValidatingParser ( ) const
pure virtual

Obtains a validating parser pool.

Library must be initialized first. Schema/catalog registration must be externally synchronized.

Returns
reference to a validating parser pool.

◆ init()

virtual bool xmltooling::XMLToolingConfig::init ( )
pure virtual

Initializes library.

Each process using the library MUST call this function exactly once before using any library classes except for the LogConfig method.

Returns
true iff initialization was successful

◆ isXMLAlgorithmSupported()

virtual bool xmltooling::XMLToolingConfig::isXMLAlgorithmSupported ( const XMLCh *  xmlAlgorithm,
XMLSecurityAlgorithmType  type = ALGTYPE_UNK 
)
pure virtual

Checks for implementation support of a particular XML Security algorithm.

Parameters
xmlAlgorithmXML Signature/Encryption algorithm identifier
typetype of algorithm, or ALGTYPE_UNK to ignore
Returns
true iff the algorithm is supported by the underlying libraries

◆ load_library()

virtual bool xmltooling::XMLToolingConfig::load_library ( const char *  path,
void *  context = 0 
)
pure virtual

Loads a shared/dynamic library extension.

Extension libraries are managed using a pair of "C" linkage functions:
extern "C" int xmltooling_extension_init(void* context);
extern "C" void xmltooling_extension_term();

This method is internally synchronized.

Parameters
pathpathname of shared library to load into process
contextarbitrary data to pass to library initialization hook
Returns
true iff library was loaded successfully

◆ log_config()

virtual bool xmltooling::XMLToolingConfig::log_config ( const char *  config = 0)
pure virtual

Configure logging system.

May be called first, before initializing the library. Other calls to it must be externally synchronized.

Parameters
configeither a logging configuration file, or a level from the set (DEBUG, INFO, NOTICE, WARN, ERROR, CRIT, ALERT, FATAL, EMERG)
Returns
true iff configuration was successful

◆ mapXMLAlgorithmToKeyAlgorithm()

virtual std::pair<const char*,unsigned int> xmltooling::XMLToolingConfig::mapXMLAlgorithmToKeyAlgorithm ( const XMLCh *  xmlAlgorithm) const
pure virtual

Maps an XML Signature/Encryption algorithm identifier to a library-specific key algorithm and size for use in resolving credentials.

Parameters
xmlAlgorithmXML Signature/Encryption algorithm identifier
Returns
a general key algorithm and key size (or 0 if the size is irrelevant)

◆ registerXMLAlgorithm()

virtual void xmltooling::XMLToolingConfig::registerXMLAlgorithm ( const XMLCh *  xmlAlgorithm,
const char *  keyAlgorithm,
unsigned int  size = 0,
XMLSecurityAlgorithmType  type = ALGTYPE_UNK 
)
pure virtual

Registers an XML Signature/Encryption algorithm identifier against a library-specific key algorithm and size for use in resolving credentials.

Parameters
xmlAlgorithmXML Signature/Encryption algorithm identifier
keyAlgorithma key algorithm
sizea key size (or 0 if the size is irrelevant)
typetype of algorithm, if known

◆ setKeyInfoResolver()

void xmltooling::XMLToolingConfig::setKeyInfoResolver ( KeyInfoResolver keyInfoResolver)

Sets the global KeyInfoResolver instance.

This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.

Parameters
keyInfoResolvernew KeyInfoResolver instance to store

◆ setPathResolver()

void xmltooling::XMLToolingConfig::setPathResolver ( PathResolver pathResolver)

Sets the global PathResolver instance.

This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.

Parameters
pathResolvernew PathResolver instance to store

◆ setReplayCache()

void xmltooling::XMLToolingConfig::setReplayCache ( ReplayCache replayCache)

Sets the global ReplayCache instance.

This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.

Parameters
replayCachenew ReplayCache instance to store

◆ setTemplateEngine()

void xmltooling::XMLToolingConfig::setTemplateEngine ( TemplateEngine templateEngine)

Sets the global TemplateEngine instance.

This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.

Parameters
templateEnginenew TemplateEngine instance to store

◆ setURLEncoder()

void xmltooling::XMLToolingConfig::setURLEncoder ( URLEncoder urlEncoder)

Sets the global URLEncoder instance.

This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.

Parameters
urlEncodernew URLEncoder instance to store

◆ term()

virtual void xmltooling::XMLToolingConfig::term ( )
pure virtual

Shuts down library.

Each process using the library SHOULD call this function exactly once before terminating itself

Member Data Documentation

◆ catalog_path

std::string xmltooling::XMLToolingConfig::catalog_path
Deprecated:
List of catalog files to load into validating parser pool at initialization time.

Like other path settings, the separator depends on the platform (semicolon on Windows, colon otherwise).

◆ m_keyInfoResolver

KeyInfoResolver* xmltooling::XMLToolingConfig::m_keyInfoResolver
protected

Global KeyInfoResolver instance.

◆ m_pathResolver

PathResolver* xmltooling::XMLToolingConfig::m_pathResolver
protected

Global PathResolver instance.

◆ m_replayCache

ReplayCache* xmltooling::XMLToolingConfig::m_replayCache
protected

Global ReplayCache instance.

◆ m_templateEngine

TemplateEngine* xmltooling::XMLToolingConfig::m_templateEngine
protected

Global TemplateEngine instance.

◆ m_urlEncoder

URLEncoder* xmltooling::XMLToolingConfig::m_urlEncoder
protected

Global URLEncoder instance for use by URL-related functions.

◆ SOAPTransportManager

PluginManager<SOAPTransport,std::string,SOAPTransport::Address> xmltooling::XMLToolingConfig::SOAPTransportManager

Manages factories for SOAPTransport plugins.

The factory interface takes a peer name/endpoint pair.

◆ user_agent

std::string xmltooling::XMLToolingConfig::user_agent

A User-Agent header to include in HTTP client requests.


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