From 270ca608be354a2adc23e957abd98dc558221ae5 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Mon, 21 May 2007 15:59:26 +0000 Subject: [PATCH] Move ReplayCache and StorageService APIs to full build only. --- xmltooling/Makefile.am | 8 +-- xmltooling/XMLToolingConfig.cpp | 15 +++-- xmltooling/XMLToolingConfig.h | 26 +++++---- xmltooling/util/ReplayCache.h | 2 +- xmltooling/util/StorageService.h | 2 +- xmltooling/xmltooling-lite.vcproj | 112 -------------------------------------- xmltoolingtest/Makefile.am | 2 +- 7 files changed, 28 insertions(+), 139 deletions(-) diff --git a/xmltooling/Makefile.am b/xmltooling/Makefile.am index ffd2e11..4d6c00e 100644 --- a/xmltooling/Makefile.am +++ b/xmltooling/Makefile.am @@ -120,6 +120,7 @@ xmlsec_sources = \ encryption/impl/Decrypter.cpp \ encryption/impl/EncryptedKeyResolver.cpp \ encryption/impl/Encrypter.cpp \ + impl/MemoryStorageService.cpp \ security/impl/AbstractPKIXTrustEngine.cpp \ security/impl/BasicX509Credential.cpp \ security/impl/ChainingCredentialResolver.cpp \ @@ -135,7 +136,9 @@ xmlsec_sources = \ security/impl/XSECCryptoX509CRL.cpp \ signature/impl/SignatureValidator.cpp \ signature/impl/XMLSecSignatureImpl.cpp \ - soap/impl/CURLSOAPTransport.cpp + soap/impl/CURLSOAPTransport.cpp \ + util/ReplayCache.cpp \ + util/StorageService.cpp if BUILD_PTHREAD thread_sources = util/PThreads.cpp @@ -158,7 +161,6 @@ common_sources = \ encryption/impl/EncryptionImpl.cpp \ encryption/impl/EncryptionSchemaValidators.cpp \ impl/AnyElement.cpp \ - impl/MemoryStorageService.cpp \ impl/UnknownElement.cpp \ io/AbstractXMLObjectMarshaller.cpp \ io/AbstractXMLObjectUnmarshaller.cpp \ @@ -171,8 +173,6 @@ common_sources = \ util/NDC.cpp \ util/ParserPool.cpp \ util/ReloadableXMLFile.cpp \ - util/ReplayCache.cpp \ - util/StorageService.cpp \ util/TemplateEngine.cpp \ util/URLEncoder.cpp \ util/XMLConstants.cpp \ diff --git a/xmltooling/XMLToolingConfig.cpp b/xmltooling/XMLToolingConfig.cpp index 4e06f3e..f4fc4d3 100644 --- a/xmltooling/XMLToolingConfig.cpp +++ b/xmltooling/XMLToolingConfig.cpp @@ -172,11 +172,13 @@ bool XMLToolingInternalConfig::log_config(const char* config) return true; } +#ifndef XMLTOOLING_LITE void XMLToolingConfig::setReplayCache(ReplayCache* replayCache) { delete m_replayCache; m_replayCache = replayCache; } +#endif void XMLToolingConfig::setTemplateEngine(TemplateEngine* templateEngine) { @@ -263,13 +265,11 @@ bool XMLToolingInternalConfig::init() registerXMLAlgorithms(); registerSOAPTransports(); initSOAPTransports(); -#endif registerStorageServices(); - - m_urlEncoder = new URLEncoder(); -#ifndef XMLTOOLING_NO_XMLSEC m_keyInfoResolver = KeyInfoResolverManager.newPlugin(INLINE_KEYINFO_RESOLVER,NULL); #endif + + m_urlEncoder = new URLEncoder(); // Register xml:id as an ID attribute. static const XMLCh xmlid[] = UNICODE_LITERAL_2(i,d); @@ -310,9 +310,8 @@ void XMLToolingInternalConfig::term() XMLToolingException::deregisterFactories(); AttributeExtensibleXMLObject::deregisterIDAttributes(); - StorageServiceManager.deregisterFactories(); - #ifndef XMLTOOLING_NO_XMLSEC + StorageServiceManager.deregisterFactories(); termSOAPTransports(); SOAPTransportManager.deregisterFactories(); TrustEngineManager.deregisterFactories(); @@ -322,11 +321,11 @@ void XMLToolingInternalConfig::term() delete m_keyInfoResolver; m_keyInfoResolver = NULL; -#endif delete m_replayCache; m_replayCache = NULL; - +#endif + delete m_templateEngine; m_templateEngine = NULL; diff --git a/xmltooling/XMLToolingConfig.h b/xmltooling/XMLToolingConfig.h index 1cbb650..cb558a0 100644 --- a/xmltooling/XMLToolingConfig.h +++ b/xmltooling/XMLToolingConfig.h @@ -43,11 +43,13 @@ namespace xmltooling { namespace xmltooling { - class XMLTOOL_API ReplayCache; class XMLTOOL_API SOAPTransport; - class XMLTOOL_API StorageService; class XMLTOOL_API TemplateEngine; class XMLTOOL_API URLEncoder; +#ifndef XMLTOOLING_LITE + class XMLTOOL_API ReplayCache; + class XMLTOOL_API StorageService; +#endif /** * Singleton object that manages library startup/shutdown.configuration. @@ -65,13 +67,13 @@ namespace xmltooling { /** Global KeyInfoResolver instance. */ KeyInfoResolver* m_keyInfoResolver; -#else - XMLToolingConfig() : m_replayCache(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {} -#endif /** Global ReplayCache instance. */ ReplayCache* m_replayCache; - +#else + XMLToolingConfig() : m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {} +#endif + /** Global TemplateEngine instance. */ TemplateEngine* m_templateEngine; @@ -168,7 +170,6 @@ namespace xmltooling { const KeyInfoResolver* getKeyInfoResolver() const { return m_keyInfoResolver; } -#endif /** * Sets the global ReplayCache instance. @@ -187,6 +188,7 @@ namespace xmltooling { ReplayCache* getReplayCache() const { return m_replayCache; } +#endif /** * Sets the global URLEncoder instance. @@ -259,6 +261,11 @@ namespace xmltooling { PluginManager TrustEngineManager; /** + * Manages factories for StorageService plugins. + */ + PluginManager StorageServiceManager; + + /** * Maps an XML Signature/Encryption algorithm identifier to a library-specific * key algorithm and size for use in resolving credentials. * @@ -284,11 +291,6 @@ namespace xmltooling { *

The factory interface takes a peer name/endpoint pair. */ PluginManager > SOAPTransportManager; - - /** - * Manages factories for StorageService plugins. - */ - PluginManager StorageServiceManager; }; }; diff --git a/xmltooling/util/ReplayCache.h b/xmltooling/util/ReplayCache.h index 33f8725..7cbc367 100644 --- a/xmltooling/util/ReplayCache.h +++ b/xmltooling/util/ReplayCache.h @@ -20,7 +20,7 @@ * Helper class on top of StorageService for detecting message replay. */ -#ifndef __xmltooling_replay_h__ +#if !defined(__xmltooling_replay_h__) && !defined(XMLTOOLING_LITE) #define __xmltooling_replay_h__ #include diff --git a/xmltooling/util/StorageService.h b/xmltooling/util/StorageService.h index d9f4802..6dd8d8e 100644 --- a/xmltooling/util/StorageService.h +++ b/xmltooling/util/StorageService.h @@ -20,7 +20,7 @@ * Generic data storage interface */ -#ifndef __xmltooling_storage_h__ +#if !defined(__xmltooling_storage_h__) && !defined(XMLTOOLING_LITE) #define __xmltooling_storage_h__ #include diff --git a/xmltooling/xmltooling-lite.vcproj b/xmltooling/xmltooling-lite.vcproj index 979107a..b164228 100644 --- a/xmltooling/xmltooling-lite.vcproj +++ b/xmltooling/xmltooling-lite.vcproj @@ -247,14 +247,6 @@ > - - - - @@ -295,10 +287,6 @@ > - - @@ -473,14 +461,6 @@ > - - - - @@ -545,111 +525,19 @@ Name="signature" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -