2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file shibsp/util/DOMPropertySet.h
20 * DOM-based property set implementation.
23 #ifndef __shibsp_dompropset_h__
24 #define __shibsp_dompropset_h__
26 #include <shibsp/util/PropertySet.h>
27 #include <log4cpp/Category.hh>
32 * DOM-based property set implementation.
34 class SHIBSP_API DOMPropertySet : public virtual PropertySet
37 DOMPropertySet() : m_root(NULL) {}
39 virtual ~DOMPropertySet();
41 std::pair<bool,bool> getBool(const char* name, const char* ns=NULL) const;
42 std::pair<bool,const char*> getString(const char* name, const char* ns=NULL) const;
43 std::pair<bool,const XMLCh*> getXMLString(const char* name, const char* ns=NULL) const;
44 std::pair<bool,unsigned int> getUnsignedInt(const char* name, const char* ns=NULL) const;
45 std::pair<bool,int> getInt(const char* name, const char* ns=NULL) const;
46 const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:target:config:1.0") const;
48 const xercesc::DOMElement* getElement() const {
53 * Loads the property set from a DOM element.
55 * @param e root element of property set
56 * @param log log object for tracing
57 * @param filter optional filter controls what child elements to include as nested PropertySets
58 * @param remapper optional map of property rename rules for legacy property support
61 const xercesc::DOMElement* e,
62 log4cpp::Category& log,
63 xercesc::DOMNodeFilter* filter,
64 const std::map<std::string,std::string>* remapper=NULL
68 const xercesc::DOMElement* m_root;
69 std::map<std::string,std::pair<char*,const XMLCh*> > m_map;
70 std::map<std::string,DOMPropertySet*> m_nested;
75 #endif /* __shibsp_dompropset_h__ */