From: cantor Date: Fri, 25 Sep 2009 16:00:54 +0000 (+0000) Subject: https://bugs.internet2.edu/jira/browse/CPPXT-42 X-Git-Tag: 1.4.1~186 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=3e6e1822c8dc73df18be26ae2f7924a1705861be https://bugs.internet2.edu/jira/browse/CPPXT-42 git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@648 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/XMLToolingConfig.cpp b/xmltooling/XMLToolingConfig.cpp index f154540..7e99906 100644 --- a/xmltooling/XMLToolingConfig.cpp +++ b/xmltooling/XMLToolingConfig.cpp @@ -111,19 +111,19 @@ namespace xmltooling { #endif #ifdef WIN32 - BOOL LogEvent( - LPCSTR lpUNCServerName, - WORD wType, - DWORD dwEventID, - PSID lpUserSid, - LPCSTR message) - { - LPCSTR messages[] = {message, NULL}; - - HANDLE hElog = RegisterEventSource(lpUNCServerName, "OpenSAML XMLTooling Library"); - BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL); - return (DeregisterEventSource(hElog) && res); - } + BOOL LogEvent( + LPCSTR lpUNCServerName, + WORD wType, + DWORD dwEventID, + PSID lpUserSid, + LPCSTR message) + { + LPCSTR messages[] = {message, NULL}; + + HANDLE hElog = RegisterEventSource(lpUNCServerName, "OpenSAML XMLTooling Library"); + BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL); + return (DeregisterEventSource(hElog) && res); + } #endif } @@ -195,7 +195,7 @@ bool XMLToolingInternalConfig::log_config(const char* config) string msg = string("failed to configure logging: ") + e.what(); Category::getInstance(XMLTOOLING_LOGCAT".Logging").crit(msg); #ifdef WIN32 - LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str()); + LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str()); #endif return false; } @@ -209,6 +209,12 @@ void XMLToolingConfig::setReplayCache(ReplayCache* replayCache) delete m_replayCache; m_replayCache = replayCache; } + +void XMLToolingConfig::setKeyInfoResolver(xmltooling::KeyInfoResolver *keyInfoResolver) +{ + delete m_keyInfoResolver; + m_keyInfoResolver = keyInfoResolver; +} #endif void XMLToolingConfig::setPathResolver(PathResolver* pathResolver) diff --git a/xmltooling/XMLToolingConfig.h b/xmltooling/XMLToolingConfig.h index 0f8ae43..3c24b2a 100644 --- a/xmltooling/XMLToolingConfig.h +++ b/xmltooling/XMLToolingConfig.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -159,15 +159,6 @@ namespace xmltooling { #ifndef XMLTOOLING_NO_XMLSEC /** - * Sets the global KeyInfoResolver instance. - * This method must be externally synchronized with any code that uses the object. - * Any previously set object is destroyed. - * - * @param keyInfoResolver new KeyInfoResolver instance to store - */ - void setKeyInfoResolver(KeyInfoResolver* keyInfoResolver); - - /** * Returns the global KeyInfoResolver instance. * * @return global KeyInfoResolver or NULL @@ -177,15 +168,6 @@ namespace xmltooling { } /** - * Sets the global ReplayCache instance. - * This method must be externally synchronized with any code that uses the object. - * Any previously set object is destroyed. - * - * @param replayCache new ReplayCache instance to store - */ - void setReplayCache(ReplayCache* replayCache); - - /** * Returns the global ReplayCache instance. * * @return global ReplayCache or NULL @@ -193,36 +175,36 @@ namespace xmltooling { ReplayCache* getReplayCache() const { return m_replayCache; } -#endif /** - * Sets the global URLEncoder instance. + * Sets the global KeyInfoResolver instance. * This method must be externally synchronized with any code that uses the object. * Any previously set object is destroyed. * - * @param urlEncoder new URLEncoder instance to store - */ - void setURLEncoder(URLEncoder* urlEncoder); - - /** - * Returns the global URLEncoder instance. - * - * @return global URLEncoder or NULL + * @param keyInfoResolver new KeyInfoResolver instance to store */ - const URLEncoder* getURLEncoder() const { - return m_urlEncoder; - } - + void setKeyInfoResolver(KeyInfoResolver* keyInfoResolver); + /** - * Sets the global TemplateEngine instance. + * Sets the global ReplayCache instance. * This method must be externally synchronized with any code that uses the object. * Any previously set object is destroyed. * - * @param templateEngine new TemplateEngine instance to store + * @param replayCache new ReplayCache instance to store */ - void setTemplateEngine(TemplateEngine* templateEngine); + void setReplayCache(ReplayCache* replayCache); +#endif /** + * Returns the global PathResolver instance. + * + * @return global PathResolver or NULL + */ + PathResolver* getPathResolver() const { + return m_pathResolver; + } + + /** * Returns the global TemplateEngine instance. * * @return global TemplateEngine or NULL @@ -232,6 +214,15 @@ namespace xmltooling { } /** + * Returns the global URLEncoder instance. + * + * @return global URLEncoder or NULL + */ + const URLEncoder* getURLEncoder() const { + return m_urlEncoder; + } + + /** * Sets the global PathResolver instance. * This method must be externally synchronized with any code that uses the object. * Any previously set object is destroyed. @@ -239,15 +230,24 @@ namespace xmltooling { * @param pathResolver new PathResolver instance to store */ void setPathResolver(PathResolver* pathResolver); + + /** + * Sets the global TemplateEngine instance. + * This method must be externally synchronized with any code that uses the object. + * Any previously set object is destroyed. + * + * @param templateEngine new TemplateEngine instance to store + */ + void setTemplateEngine(TemplateEngine* templateEngine); /** - * Returns the global PathResolver instance. + * Sets the global URLEncoder instance. + * This method must be externally synchronized with any code that uses the object. + * Any previously set object is destroyed. * - * @return global PathResolver or NULL + * @param urlEncoder new URLEncoder instance to store */ - PathResolver* getPathResolver() const { - return m_pathResolver; - } + void setURLEncoder(URLEncoder* urlEncoder); /** * List of catalog files to load into validating parser pool at initialization time.