Add method to read all properties.
[shibboleth/cpp-sp.git] / shibsp / util / DOMPropertySet.h
index d46d288..ca9cfbb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
 #define __shibsp_dompropset_h__
 
 #include <shibsp/util/PropertySet.h>
-#include <log4cpp/Category.hh>
+#include <xmltooling/logging.h>
 
 namespace shibsp {
 
@@ -34,16 +34,25 @@ namespace shibsp {
     class SHIBSP_API DOMPropertySet : public virtual PropertySet
     {
     public:
-        DOMPropertySet() {}
+        DOMPropertySet() : m_parent(NULL), m_root(NULL) {}
         
         virtual ~DOMPropertySet();
 
+        const PropertySet* getParent() const {
+            return m_parent;
+        }
+
+        void setParent(const PropertySet* parent) {
+            m_parent = parent;
+        }
+
         std::pair<bool,bool> getBool(const char* name, const char* ns=NULL) const;
         std::pair<bool,const char*> getString(const char* name, const char* ns=NULL) const;
         std::pair<bool,const XMLCh*> getXMLString(const char* name, const char* ns=NULL) const;
         std::pair<bool,unsigned int> getUnsignedInt(const char* name, const char* ns=NULL) const;
         std::pair<bool,int> getInt(const char* name, const char* ns=NULL) const;
-        const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:target:config:1.0") const;
+        void getAll(std::map<std::string,const char*>& properties) const;
+        const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:2.0:native:sp:config") const;
 
         const xercesc::DOMElement* getElement() const {
             return m_root;
@@ -59,16 +68,18 @@ namespace shibsp {
          */
         void load(
             const xercesc::DOMElement* e,
-            log4cpp::Category& log,
+            xmltooling::logging::Category& log,
             xercesc::DOMNodeFilter* filter,
             const std::map<std::string,std::string>* remapper=NULL
             );
 
     private:
+        const PropertySet* m_parent;
         const xercesc::DOMElement* m_root;
         std::map<std::string,std::pair<char*,const XMLCh*> > m_map;
         std::map<std::string,DOMPropertySet*> m_nested;
     };
+
 };
 
 #endif /* __shibsp_dompropset_h__ */