ARP match function that matches against any string value.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 23 May 2006 20:27:50 +0000 (20:27 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 23 May 2006 20:27:50 +0000 (20:27 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1943 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/arp/ArpEngine.java
src/edu/internet2/middleware/shibboleth/aa/arp/provider/AnyValueMatchFunction.java [new file with mode: 0644]

index 7660b5f..aa200f3 100755 (executable)
@@ -64,6 +64,8 @@ public class ArpEngine {
                                        "edu.internet2.middleware.shibboleth.aa.arp.provider.StringValueMatchFunction");
                        matchFunctions.put(new URI("urn:mace:shibboleth:arp:matchFunction:stringNotMatch"),
                                        "edu.internet2.middleware.shibboleth.aa.arp.provider.StringValueNotMatchFunction");
+                       matchFunctions.put(new URI("urn:mace:shibboleth:arp:matchFunction:anyValueMatch"),
+                       "edu.internet2.middleware.shibboleth.aa.arp.provider.AnyValueMatchFunction");
 
                } catch (URISyntaxException e) {
                        log.error("Error mapping standard match functions: " + e);
diff --git a/src/edu/internet2/middleware/shibboleth/aa/arp/provider/AnyValueMatchFunction.java b/src/edu/internet2/middleware/shibboleth/aa/arp/provider/AnyValueMatchFunction.java
new file mode 100644 (file)
index 0000000..b213258
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.aa.arp.provider;
+
+import edu.internet2.middleware.shibboleth.aa.arp.MatchFunction;
+import edu.internet2.middleware.shibboleth.aa.arp.MatchingException;
+
+/**
+ * Function that will match against any string value.
+ * 
+ * @author Walter Hoehn
+ */
+public class AnyValueMatchFunction implements MatchFunction {
+
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.arp.MatchFunction#match(Object, Object)
+        */
+       public boolean match(Object arpComponent, Object requestComponent) throws MatchingException {
+
+               if (requestComponent != null && requestComponent instanceof String) { return true; }
+               return false;
+       }
+}