Path resolution for error templates.
[shibboleth/sp.git] / shibsp / SPConfig.h
index 4e62b8c..81499cd 100644 (file)
@@ -24,7 +24,9 @@
 #define __shibsp_config_h__
 
 #include <shibsp/base.h>
-#include <saml/binding/MessageDecoder.h>
+#ifndef SHIBSP_LITE
+# include <saml/binding/MessageDecoder.h>
+#endif
 #include <xmltooling/PluginManager.h>
 #include <xercesc/dom/DOM.hpp>
 
 namespace shibsp {
 
     class SHIBSP_API AccessControl;
-    class SHIBSP_API AttributeDecoder;
-    class SHIBSP_API AttributeExtractor;
-    class SHIBSP_API AttributeFilter;
-    class SHIBSP_API AttributeResolver;
     class SHIBSP_API Handler;
     class SHIBSP_API ListenerService;
-    class SHIBSP_API MatchFunctor;
     class SHIBSP_API RequestMapper;
     class SHIBSP_API ServiceProvider;
     class SHIBSP_API SessionCache;
     class SHIBSP_API SessionInitiator;
 
+#ifndef SHIBSP_LITE
+    class SHIBSP_API AttributeDecoder;
+    class SHIBSP_API AttributeExtractor;
+    class SHIBSP_API AttributeFilter;
+    class SHIBSP_API AttributeResolver;
+    class SHIBSP_API FilterPolicyContext;
+    class SHIBSP_API MatchFunctor;
+#endif
+
 #if defined (_MSC_VER)
     #pragma warning( push )
     #pragma warning( disable : 4250 4251 )
@@ -57,8 +63,14 @@ namespace shibsp {
      */
     class SHIBSP_API SPConfig
     {
-    MAKE_NONCOPYABLE(SPConfig);
+        MAKE_NONCOPYABLE(SPConfig);
     public:
+        SPConfig() : attribute_value_delimeter(';'), m_serviceProvider(NULL),
+#ifndef SHIBSP_LITE
+            m_artifactResolver(NULL),
+#endif
+            m_features(0) {}
+
         virtual ~SPConfig() {}
 
         /**
@@ -74,14 +86,17 @@ namespace shibsp {
         enum components_t {
             Listener = 1,
             Caching = 2,
+#ifndef SHIBSP_LITE
             Metadata = 4,
             Trust = 8,
             Credentials = 16,
             AttributeResolution = 32,
+#endif
             RequestMapping = 64,
             OutOfProcess = 128,
             InProcess = 256,
-            Logging = 512
+            Logging = 512,
+            Handlers = 1024
         };
         
         /**
@@ -110,9 +125,10 @@ namespace shibsp {
          * before using any library classes.
          * 
          * @param catalog_path  delimited set of schema catalog files to load
+         * @param inst_prefix   installation prefix for software
          * @return true iff initialization was successful 
          */
-        virtual bool init(const char* catalog_path)=0;
+        virtual bool init(const char* catalog_path=NULL, const char* inst_prefix=NULL);
         
         /**
          * Shuts down library
@@ -120,7 +136,7 @@ namespace shibsp {
          * Each process using the library SHOULD call this function exactly once
          * before terminating itself.
          */
-        virtual void term()=0;
+        virtual void term();
         
         /**
          * Sets the global ServiceProvider instance.
@@ -140,6 +156,7 @@ namespace shibsp {
             return m_serviceProvider;
         }
 
+#ifndef SHIBSP_LITE
         /**
          * Sets the global ArtifactResolver instance.
          *
@@ -161,6 +178,7 @@ namespace shibsp {
         opensaml::MessageDecoder::ArtifactResolver* getArtifactResolver() const {
             return m_artifactResolver;
         }
+#endif
 
         /** Separator for serialized values of multi-valued attributes. */
         char attribute_value_delimeter;
@@ -170,6 +188,7 @@ namespace shibsp {
          */
         xmltooling::PluginManager<AccessControl,std::string,const xercesc::DOMElement*> AccessControlManager;
 
+#ifndef SHIBSP_LITE
         /**
          * Manages factories for AttributeDecoder plugins.
          */
@@ -191,6 +210,17 @@ namespace shibsp {
         xmltooling::PluginManager<AttributeResolver,std::string,const xercesc::DOMElement*> AttributeResolverManager;
 
         /**
+         * Manages factories for MatchFunctor plugins.
+         */
+        xmltooling::PluginManager< MatchFunctor,xmltooling::QName,std::pair<const FilterPolicyContext*,const xercesc::DOMElement*> > MatchFunctorManager;
+#endif
+
+        /**
+         * Manages factories for Handler plugins that implement ArtifactResolutionService functionality.
+         */
+        xmltooling::PluginManager< Handler,std::string,std::pair<const xercesc::DOMElement*,const char*> > ArtifactResolutionServiceManager;
+
+        /**
          * Manages factories for Handler plugins that implement AssertionConsumerService functionality.
          */
         xmltooling::PluginManager< Handler,std::string,std::pair<const xercesc::DOMElement*,const char*> > AssertionConsumerServiceManager;
@@ -206,9 +236,9 @@ namespace shibsp {
         xmltooling::PluginManager<ListenerService,std::string,const xercesc::DOMElement*> ListenerServiceManager;
 
         /**
-         * Manages factories for MatchFunctor plugins.
+         * Manages factories for Handler plugins that implement LogoutInitiator functionality.
          */
-        xmltooling::PluginManager<MatchFunctor,xmltooling::QName,const xercesc::DOMElement*> MatchFunctorManager;
+        xmltooling::PluginManager< Handler,std::string,std::pair<const xercesc::DOMElement*,const char*> > LogoutInitiatorManager;
 
         /**
          * Manages factories for Handler plugins that implement ManageNameIDService functionality.
@@ -241,13 +271,13 @@ namespace shibsp {
         xmltooling::PluginManager< Handler,std::string,std::pair<const xercesc::DOMElement*,const char*> > SingleLogoutServiceManager;
 
     protected:
-        SPConfig() : attribute_value_delimeter(';'), m_serviceProvider(NULL), m_artifactResolver(NULL), m_features(0) {}
-        
         /** Global ServiceProvider instance. */
         ServiceProvider* m_serviceProvider;
 
+#ifndef SHIBSP_LITE
         /** Global ArtifactResolver instance. */
         opensaml::MessageDecoder::ArtifactResolver* m_artifactResolver;
+#endif
 
     private:
         unsigned long m_features;