2 * Copyright 2001-2006 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/PropertySet.h
20 * Interface to a generic set of typed properties or a DOM container of additional data.
23 #ifndef __shibsp_propset_h__
24 #define __shibsp_propset_h__
26 #include <shibsp/base.h>
27 #include <xercesc/dom/DOM.hpp>
32 * Interface to a generic set of typed properties or a DOM container of additional data.
34 class SHIBSP_API PropertySet
36 MAKE_NONCOPYABLE(PropertySet);
40 virtual ~PropertySet() {}
43 * Returns a boolean-valued property.
45 * @param name property name
46 * @param ns property namespace, or NULL
47 * @return a pair consisting of a NULL indicator and the property value iff the indicator is true
49 virtual std::pair<bool,bool> getBool(const char* name, const char* ns=NULL) const=0;
52 * Returns a string-valued property.
54 * @param name property name
55 * @param ns property namespace, or NULL
56 * @return a pair consisting of a NULL indicator and the property value iff the indicator is true
58 virtual std::pair<bool,const char*> getString(const char* name, const char* ns=NULL) const=0;
61 * Returns a Unicode string-valued property.
63 * @param name property name
64 * @param ns property namespace, or NULL
65 * @return a pair consisting of a NULL indicator and the property value iff the indicator is true
67 virtual std::pair<bool,const XMLCh*> getXMLString(const char* name, const char* ns=NULL) const=0;
70 * Returns an unsigned integer-valued property.
72 * @param name property name
73 * @param ns property namespace, or NULL
74 * @return a pair consisting of a NULL indicator and the property value iff the indicator is true
76 virtual std::pair<bool,unsigned int> getUnsignedInt(const char* name, const char* ns=NULL) const=0;
79 * Returns an integer-valued property.
81 * @param name property name
82 * @param ns property namespace, or NULL
83 * @return a pair consisting of a NULL indicator and the property value iff the indicator is true
85 virtual std::pair<bool,int> getInt(const char* name, const char* ns=NULL) const=0;
88 * Returns a nested property set.
90 * @param name nested property set name
91 * @param ns nested property set namespace, or NULL
92 * @return the nested property set, or NULL
94 virtual const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:target:config:1.0") const=0;
97 * Returns a DOM element representing the property container, if any.
99 * @return a DOM element, or NULL
101 virtual const xercesc::DOMElement* getElement() const=0;
105 #endif /* __shibsp_propset_h__ */