SSPCPP-616 - clean up concatenated string literals
[shibboleth/cpp-sp.git] / shibsp / attribute / filtering / impl / DummyAttributeFilter.cpp
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * DummyAttributeFilter.cpp
23  * 
24  * Pathological AttributeFilter that rejects all attributes.
25  */
26
27 #include "internal.h"
28 #include "attribute/Attribute.h"
29 #include "attribute/filtering/AttributeFilter.h"
30
31 using namespace shibsp;
32 using namespace xmltooling;
33 using namespace std;
34
35 namespace shibsp {
36
37     class SHIBSP_DLLLOCAL DummyAttributeFilter : public AttributeFilter
38     {
39     public:
40         DummyAttributeFilter(const DOMElement* e) {
41         }
42         virtual ~DummyAttributeFilter() {
43         }
44         
45         Lockable* lock() {
46             return this;
47         }
48         void unlock() {
49         }
50         
51         void filterAttributes(const FilteringContext& context, vector<Attribute*>& attributes) const {
52             Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.Dummy").warn("filtering out all attributes");
53             for_each(attributes.begin(), attributes.end(), xmltooling::cleanup<Attribute>());
54             attributes.clear();
55         }
56     };
57
58     AttributeFilter* SHIBSP_DLLLOCAL DummyAttributeFilterFactory(const DOMElement* const & e)
59     {
60         return new DummyAttributeFilter(e);
61     }
62 };